Skip to content

Commit

Permalink
docs: update README and CHANGELOG
Browse files Browse the repository at this point in the history
  • Loading branch information
tklockau committed Nov 18, 2024
1 parent 7a71a53 commit 5631f04
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 2 deletions.
8 changes: 6 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,11 @@ Functionality, that has been **moved** to the `raillabel_providerkit`:

Other breaking changes:
- the `fromdict()` and `asdict()` methods in `raillabel.format` classes have been replaced with `from_json()` and `to_json` respectively
- `raillabel.format.Transform` fields have been changed by `pos -> position` and `quad -> quaternion` to make it more explicit
- `raillabel.format.FrameInterval` fields have been changed by `frame_start -> start` and `frame_end -> end` to make it more concise
- `raillabel.format.Frame.uid` field has been removed to avoid redundant information
- all uid fields of classes have been removed (like `raillabel.format.Frame.uid`) have been removed to avoid redundant information
- `raillabel.format.Sensor` has been removed in favor of the different sensor type classes `raillabel.format.Camera`, `raillabel.format.Lidar`, `raillabel.format.Radar` and `raillabel.format.GpsImu`
- `raillabel.filter()` has been removed in favor of `raillabel.Scene.filter()` with different input arguments

New features:
- `raillabel.json_format` has been introduced as an interface between the JSON format and the `raillabel` classes
- `raillabel.scene_builder.SceneBuilder` is now available to easily build scenes for testing purposes
27 changes: 27 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,33 @@ scene = raillabel.load("path/to/annotation_file.json")

This returns a [`raillabel.Scene`](https://dsd-dbs.github.io/raillabel/code/raillabel.html#raillabel.Scene), which is the root class for the annotations.

If a file is too extensive for your use-case you can filter out certain parts of a scene like this
```python
from raillabel.filter import (
IncludeObjectTypeFilter,
ExcludeAnnotationTypeFilter,
StartTimeFilter, ExcludeFrameIdFilter,
IncludeAttributesFilter
)

scene_with_only_trains = scene.filter([IncludeObjectTypeFilter(["rail_vehicle"])])

scene_without_bboxs = scene.filter([ExcludeAnnotationTypeFilter(["bbox"])])

cut_scene_with_only_red_trains = scene.filter([
StartTimeFilter("1587349200.004200000"),
ExcludeFrameIdFilter([2, 4]),
IncludeObjectTypeFilter(["rail_vehicle"]),
IncludeAttributesFilter({"color": "red"}),
])
```
An overview of all available filters can be found [here](https://dsd-dbs.github.io/raillabel/code/raillabel.filter.html#module-raillabel.filter).

If you then want to save your changes, then use
```python
raillabel.save(cut_scene_with_only_red_trains, "/path/to/target.json")
```

# Contributing

We'd love to see your bug reports and improvement suggestions! Please take a
Expand Down

0 comments on commit 5631f04

Please sign in to comment.