vis4d.vis.image.bev_visualizer

BEV Bounding box 3D visualizer.

Classes

BEVBBox3DVisualizer(*args[, n_colors, ...])

BEV Bounding box 3D visualizer class.

BEVBox(corners, color, track_id)

Dataclass storing box informations.

DataSample(name, extrinsics, sequence_name, ...)

Dataclass storing a data sample that can be visualized.

class BEVBBox3DVisualizer(*args, n_colors=50, file_type='png', max_range=60, scale=10, width=2, margin=10, axis_mode=AxisMode.ROS, trajectory_length=10, plot_trajectory=True, canvas=None, viewer=None, **kwargs)[source]

BEV Bounding box 3D visualizer class.

Creates a new Visualizer for BEV Image and Bounding Boxes.

Parameters:
  • n_colors (int) – How many colors should be used for the internal color map. Defaults to 100.

  • file_type (str) – Desired file type. Defaults to “png”.

  • max_range (float) – Maximum range (meters) of the BEV image. Defaults to 60.

  • scale (float) – Scale of the BEV image. Defaults to 10. Means that 1m in the BEV image is 10px.

  • width (int) – Width of the drawn bounding boxes. Defaults to 2.

  • margin (int) – Margin of the BEV image. Defaults to 10.

  • axis_mode (AxisMode) – Axis mode for the input bboxes. Defaults to AxisMode.ROS (i.e. global coordinate).

  • trajectory_length (int) – How many past frames should be used to draw the trajectory. Defaults to 10.

  • plot_trajectory (bool) – If the trajectory should be plotted. Defaults to True.

  • canvas (CanvasBackend) – Backend that is used to draw on images. If None a PillowCanvasBackend is used.

  • viewer (ImageViewerBackend) – Backend that is used show images. If None a MatplotlibImageViewer is used.

process(cur_iter, sample_names, boxes3d, extrinsics, class_ids=None, track_ids=None, sequence_names=None)[source]

Processes a batch of data.

Return type:

None

process_single(sample_name, boxes3d, extrinsics, class_ids=None, track_ids=None, sequence_name=None)[source]

Process single batch.

Return type:

None

reset()[source]

Reset visualizer.

Return type:

None

save_to_disk(cur_iter, output_folder)[source]

Saves the visualization to disk.

Writes all processes samples to the output folder naming each image <sample.image_name>.<filetype>.

Parameters:
  • cur_iter (int) – Current iteration.

  • output_folder (str) – Folder where the output should be written.

Return type:

None

show(cur_iter, blocking=True)[source]

Shows the processed images in a interactive window.

Parameters:
  • cur_iter (int) – Current iteration.

  • blocking (bool) – If the visualizer should be blocking i.e. wait for human input for each image. Defaults to True.

Return type:

None

class BEVBox(corners, color, track_id)[source]

Dataclass storing box informations.

class DataSample(name, extrinsics, sequence_name, boxes)[source]

Dataclass storing a data sample that can be visualized.