raillabel.filter package

Submodules

raillabel.filter.end_time_filter module

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

Bases: _FrameLevelFilter

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

end_time: float | Decimal
passes_filter(_: int, frame: Frame) bool

Assess if a frame passes this filter.

raillabel.filter.exclude_annotation_id_filter module

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

Bases: _AnnotationLevelFilter

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

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.

raillabel.filter.exclude_annotation_type_filter module

class raillabel.filter.exclude_annotation_type_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).

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.

raillabel.filter.exclude_attributes_filter module

class raillabel.filter.exclude_attributes_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.

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.

raillabel.filter.exclude_frame_id_filter module

class raillabel.filter.exclude_frame_id_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.

frame_ids: set[int] | list[int]
passes_filter(frame_id: int, _: Frame) bool

Assess if a frame passes this filter.

raillabel.filter.exclude_object_id_filter module

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

Bases: _AnnotationLevelFilter

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

object_ids: list[UUID]
passes_filter(_: UUID, annotation: Bbox | Cuboid | Poly2d | Poly3d | Seg3d, __: Scene) bool

Assess if an annotation passes this filter.

raillabel.filter.exclude_object_type_filter module

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

Bases: _AnnotationLevelFilter

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

object_types: list[str]
passes_filter(_: UUID, annotation: Bbox | Cuboid | Poly2d | Poly3d | Seg3d, scene: Scene) bool

Assess if an annotation passes this filter.

raillabel.filter.exclude_sensor_id_filter module

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

Bases: _AnnotationLevelFilter

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

passes_filter(_: UUID, annotation: Bbox | Cuboid | Poly2d | Poly3d | Seg3d, __: Scene) bool

Assess if an annotation passes this filter.

sensor_ids: set[str] | list[str]

raillabel.filter.exclude_sensor_type_filter module

class raillabel.filter.exclude_sensor_type_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’).

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']]

raillabel.filter.include_annotation_id_filter module

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

Bases: _AnnotationLevelFilter

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

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.

raillabel.filter.include_annotation_type_filter module

class raillabel.filter.include_annotation_type_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).

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.

raillabel.filter.include_attributes_filter module

class raillabel.filter.include_attributes_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.

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.

raillabel.filter.include_frame_id_filter module

class raillabel.filter.include_frame_id_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.

frame_ids: set[int] | list[int]
passes_filter(frame_id: int, _: Frame) bool

Assess if a frame passes this filter.

raillabel.filter.include_object_id_filter module

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

Bases: _AnnotationLevelFilter

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

object_ids: list[UUID]
passes_filter(_: UUID, annotation: Bbox | Cuboid | Poly2d | Poly3d | Seg3d, __: Scene) bool

Assess if an annotation passes this filter.

raillabel.filter.include_object_type_filter module

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

Bases: _AnnotationLevelFilter

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

object_types: list[str]
passes_filter(_: UUID, annotation: Bbox | Cuboid | Poly2d | Poly3d | Seg3d, scene: Scene) bool

Assess if an annotation passes this filter.

raillabel.filter.include_sensor_id_filter module

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

Bases: _AnnotationLevelFilter

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

passes_filter(_: UUID, annotation: Bbox | Cuboid | Poly2d | Poly3d | Seg3d, __: Scene) bool

Assess if an annotation passes this filter.

sensor_ids: set[str] | list[str]

raillabel.filter.include_sensor_type_filter module

class raillabel.filter.include_sensor_type_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’).

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']]

raillabel.filter.start_time_filter module

class raillabel.filter.start_time_filter.StartTimeFilter(start_time: float | Decimal)

Bases: _FrameLevelFilter

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

passes_filter(_: int, frame: Frame) bool

Assess if a frame passes this filter.

start_time: float | Decimal

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.

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.

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).

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.

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.

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.

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’).

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.

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’).

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.

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).

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.

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.

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.

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’).

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.

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’).

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.

passes_filter(_: int, frame: Frame) bool

Assess if a frame passes this filter.

start_time: float | Decimal