raillabel.filter package

Submodules

Module contents

Package for the raillabel filter functionality.

class raillabel.filter.EndTimeFilter(end_time: float | Decimal)

Bases: _FrameLevelFilter

Filter out all the frames in the scene with timestamps higher than the end_time.

_abc_impl = <_abc._abc_data object>
end_time: float | Decimal
passes_filter(_: int, frame: Frame) bool

Assess if a frame passes this filter.

class raillabel.filter.ExcludeAnnotationIdFilter(annotation_ids: set[UUID] | list[UUID])

Bases: _AnnotationLevelFilter

Filter out all annotations in the scene, that do have disallowed ids.

_abc_impl = <_abc._abc_data object>
annotation_ids: set[UUID] | list[UUID]
passes_filter(annotation_id: UUID, _: Bbox | Cuboid | Poly2d | Poly3d | Seg3d, __: Scene) bool

Assess if an annotation passes this filter.

class raillabel.filter.ExcludeAnnotationTypeFilter(annotation_types: set[Literal['bbox', 'cuboid', 'poly2d', 'poly3d', 'seg3d']] | list[Literal['bbox', 'cuboid', 'poly2d', 'poly3d', 'seg3d']])

Bases: _AnnotationLevelFilter

Filter out all annotations in the scene, that do have the type (like bbox or cuboid).

_abc_impl = <_abc._abc_data object>
annotation_types: set[Literal['bbox', 'cuboid', 'poly2d', 'poly3d', 'seg3d']] | list[Literal['bbox', 'cuboid', 'poly2d', 'poly3d', 'seg3d']]
passes_filter(_: UUID, annotation: Bbox | Cuboid | Poly2d | Poly3d | Seg3d, __: Scene) bool

Assess if an annotation passes this filter.

class raillabel.filter.ExcludeAttributesFilter(attributes: dict[str, bool | float | str | list | None])

Bases: _AnnotationLevelFilter

Filter out all annotations in the scene, that do have matching attributes.

If an attribute has None as the value, all annotations are included, that do not have this attribute. If the value is anything other than None, all annotations are included that do not have the attribute or where the value does not match.

_abc_impl = <_abc._abc_data object>
attributes: dict[str, bool | float | str | list | None]
passes_filter(_: UUID, annotation: Bbox | Cuboid | Poly2d | Poly3d | Seg3d, __: Scene) bool

Assess if an annotation passes this filter.

class raillabel.filter.ExcludeFrameIdFilter(frame_ids: set[int] | list[int])

Bases: _FrameLevelFilter

Filter out all the frames in the scene that do match a list of disallowed ids.

_abc_impl = <_abc._abc_data object>
frame_ids: set[int] | list[int]
passes_filter(frame_id: int, _: Frame) bool

Assess if a frame passes this filter.

class raillabel.filter.ExcludeObjectIdFilter(object_ids: list[UUID])

Bases: _AnnotationLevelFilter

Filter out all annotations in the scene, that do have matching object ids.

_abc_impl = <_abc._abc_data object>
object_ids: list[UUID]
passes_filter(_: UUID, annotation: Bbox | Cuboid | Poly2d | Poly3d | Seg3d, __: Scene) bool

Assess if an annotation passes this filter.

class raillabel.filter.ExcludeObjectTypeFilter(object_types: list[str])

Bases: _AnnotationLevelFilter

Filter out all annotations in the scene, that do match the type (like ‘person’).

_abc_impl = <_abc._abc_data object>
object_types: list[str]
passes_filter(_: UUID, annotation: Bbox | Cuboid | Poly2d | Poly3d | Seg3d, scene: Scene) bool

Assess if an annotation passes this filter.

class raillabel.filter.ExcludeSensorIdFilter(sensor_ids: set[str] | list[str])

Bases: _AnnotationLevelFilter

Filter out all annotations in the scene, that do NOT have matching sensor ids.

_abc_impl = <_abc._abc_data object>
passes_filter(_: UUID, annotation: Bbox | Cuboid | Poly2d | Poly3d | Seg3d, __: Scene) bool

Assess if an annotation passes this filter.

sensor_ids: set[str] | list[str]
class raillabel.filter.ExcludeSensorTypeFilter(sensor_types: list[Literal['camera', 'lidar', 'radar', 'gps_imu', 'other']])

Bases: _AnnotationLevelFilter

Filter out all annotations in the scene, that do match the sensor type (like ‘camera’).

_abc_impl = <_abc._abc_data object>
passes_filter(_: UUID, annotation: Bbox | Cuboid | Poly2d | Poly3d | Seg3d, scene: Scene) bool

Assess if an annotation passes this filter.

sensor_types: list[Literal['camera', 'lidar', 'radar', 'gps_imu', 'other']]
class raillabel.filter.IncludeAnnotationIdFilter(annotation_ids: set[UUID] | list[UUID])

Bases: _AnnotationLevelFilter

Filter out all annotations in the scene, that do NOT have the correct ids.

_abc_impl = <_abc._abc_data object>
annotation_ids: set[UUID] | list[UUID]
passes_filter(annotation_id: UUID, _: Bbox | Cuboid | Poly2d | Poly3d | Seg3d, __: Scene) bool

Assess if an annotation passes this filter.

class raillabel.filter.IncludeAnnotationTypeFilter(annotation_types: set[Literal['bbox', 'cuboid', 'poly2d', 'poly3d', 'seg3d']] | list[Literal['bbox', 'cuboid', 'poly2d', 'poly3d', 'seg3d']])

Bases: _AnnotationLevelFilter

Filter out all annotations in the scene, that do NOT have the type (like bbox or cuboid).

_abc_impl = <_abc._abc_data object>
annotation_types: set[Literal['bbox', 'cuboid', 'poly2d', 'poly3d', 'seg3d']] | list[Literal['bbox', 'cuboid', 'poly2d', 'poly3d', 'seg3d']]
passes_filter(_: UUID, annotation: Bbox | Cuboid | Poly2d | Poly3d | Seg3d, __: Scene) bool

Assess if an annotation passes this filter.

class raillabel.filter.IncludeAttributesFilter(attributes: dict[str, bool | float | str | list | None])

Bases: _AnnotationLevelFilter

Filter out all annotations in the scene, that do NOT have matching attributes.

If an attribute has None as the value, all annotations are excluded, that do not have this attribute. If the value is anything other than None, all annotations are excluded that do not have the attribute or where the value does not match.

_abc_impl = <_abc._abc_data object>
attributes: dict[str, bool | float | str | list | None]
passes_filter(_: UUID, annotation: Bbox | Cuboid | Poly2d | Poly3d | Seg3d, __: Scene) bool

Assess if an annotation passes this filter.

class raillabel.filter.IncludeFrameIdFilter(frame_ids: set[int] | list[int])

Bases: _FrameLevelFilter

Filter out all the frames in the scene that do NOT match a list of allowed ids.

_abc_impl = <_abc._abc_data object>
frame_ids: set[int] | list[int]
passes_filter(frame_id: int, _: Frame) bool

Assess if a frame passes this filter.

class raillabel.filter.IncludeObjectIdFilter(object_ids: list[UUID])

Bases: _AnnotationLevelFilter

Filter out all annotations in the scene, that do NOT have matching object ids.

_abc_impl = <_abc._abc_data object>
object_ids: list[UUID]
passes_filter(_: UUID, annotation: Bbox | Cuboid | Poly2d | Poly3d | Seg3d, __: Scene) bool

Assess if an annotation passes this filter.

class raillabel.filter.IncludeObjectTypeFilter(object_types: list[str])

Bases: _AnnotationLevelFilter

Filter out all annotations in the scene, that do NOT match the type (like ‘person’).

_abc_impl = <_abc._abc_data object>
object_types: list[str]
passes_filter(_: UUID, annotation: Bbox | Cuboid | Poly2d | Poly3d | Seg3d, scene: Scene) bool

Assess if an annotation passes this filter.

class raillabel.filter.IncludeSensorIdFilter(sensor_ids: set[str] | list[str])

Bases: _AnnotationLevelFilter

Filter out all annotations in the scene, that do NOT have matching sensor ids.

_abc_impl = <_abc._abc_data object>
passes_filter(_: UUID, annotation: Bbox | Cuboid | Poly2d | Poly3d | Seg3d, __: Scene) bool

Assess if an annotation passes this filter.

sensor_ids: set[str] | list[str]
class raillabel.filter.IncludeSensorTypeFilter(sensor_types: list[Literal['camera', 'lidar', 'radar', 'gps_imu', 'other']])

Bases: _AnnotationLevelFilter

Filter out all annotations in the scene, that do NOT match the sensor type (like ‘camera’).

_abc_impl = <_abc._abc_data object>
passes_filter(_: UUID, annotation: Bbox | Cuboid | Poly2d | Poly3d | Seg3d, scene: Scene) bool

Assess if an annotation passes this filter.

sensor_types: list[Literal['camera', 'lidar', 'radar', 'gps_imu', 'other']]
class raillabel.filter.StartTimeFilter(start_time: float | Decimal)

Bases: _FrameLevelFilter

Filter out all the frames in the scene with timestamps lower than the start_time.

_abc_impl = <_abc._abc_data object>
passes_filter(_: int, frame: Frame) bool

Assess if a frame passes this filter.

start_time: float | Decimal