PointcloudFigure¶
-
class PointcloudFigure(parent_object, geometry, frame_index=
None, key=None, class_id=None, labeler_login=None, updated_at=None, created_at=None, **kwargs)[source]¶ Bases:
VideoFigureFigure in point cloud annotation: 3D geometry (e.g. Cuboid3d) at a frame. Immutable.
Figure in point cloud annotation.
- Parameters:
- parent_object¶
PointcloudObject or PointcloudEpisodeObject.
- geometry¶
3D geometry (Cuboid3d or Pointcloud).
- frame_index : int, optional¶
Frame index. Optional for single-frame point clouds.
- key : uuid.UUID, optional¶
UUID key. Auto-generated if not provided.
- class_id : int, optional¶
Server-side class ID.
- labeler_login : str, optional¶
Login of user who created the figure.
- updated_at : str, optional¶
Last modification timestamp (ISO format).
- created_at : str, optional¶
Creation timestamp (ISO format).
- Usage Example:
import supervisely as sly from supervisely.geometry.cuboid_3d import Cuboid3d, Vector3d obj_class_car = sly.ObjClass('car', Cuboid3d) pointcloud_obj_car = sly.PointcloudObject(obj_class_car) cuboid = Cuboid3d( Vector3d(-3.4, 28.9, -0.7), Vector3d(0., 0, -0.03), Vector3d(1.8, 3.9, 1.6), ) figure = sly.PointcloudFigure(pointcloud_obj_car, cuboid, frame_index=10) print(figure.to_json())
Methods
Makes a copy of PointcloudFigure with new fields, if fields are given, otherwise it will use fields of the original PointcloudFigure.
Convert a json dict to PointcloudFigure.
Get metadata for the video figure.
Figure key.
Convert the VideoFigure to a json dict.
Not supported for pointcloud.
Attributes
Frame index of the current VideoFigure.
Geometry of the current VideoFigure.
PointcloudObject of current PointcloudFigure.
Priority of the figure (position of the figure relative to other overlapping or underlying figures).
Smart Tool parameters that were used for labeling.
Labeling status.
Not supported for pointcloud.
-
classmethod from_json(data, objects, frame_index=
None, key_id_map=None)[source]¶ Convert a json dict to PointcloudFigure. Read more about Supervisely format.
- Parameters:
- Raises:
RuntimeError – if point cloudobject ID and pointcloud object key are None, if pointcloud object key and key_id_map are None, if pointcloud object with given id not found in key_id_map
- Returns:
Pointcloud figure object.
- Return type:
- Usage Example:
import supervisely as sly from supervisely.geometry.cuboid_3d import Cuboid3d, Vector3d obj_class_car = sly.ObjClass('car', Cuboid3d) pointcloud_obj_car = sly.PointcloudObject(obj_class_car) position, rotation, dimension = Vector3d(-3.4, 28.9, -0.7), Vector3d(0., 0, -0.03), Vector3d(1.8, 3.9, 1.6) cuboid = Cuboid3d(position, rotation, dimension) frame_index = 10 figure = sly.PointcloudFigure(pointcloud_obj_car, cuboid, frame_index=frame_index) pointcloud_figure_json = figure.to_json(save_meta=True) new_pointcloud_figure = sly.PointcloudFigure.from_json( pointcloud_figure_json, sly.PointcloudObjectCollection([pointcloud_obj_car]), frame_index )
-
clone(parent_object=
None, geometry=None, frame_index=None, key=None, class_id=None, labeler_login=None, updated_at=None, created_at=None)[source]¶ Makes a copy of PointcloudFigure with new fields, if fields are given, otherwise it will use fields of the original PointcloudFigure.
- Parameters:
- parent_object=
None¶ Pointcloud object or pointcloud episode object.
- geometry=
None¶ Label
Geometry.- frame_index : int, optional¶
Index of Frame to which PointcloudFigure belongs.
- key : uuid.UUID¶
UUID key associated with the figure.
- class_id : int, optional¶
ID of pointcloud object (or pointcloud episode object) to which PointcloudFigure belongs.
- labeler_login : str, optional¶
Login of the user who created
PointcloudFigure.- updated_at : str, optional¶
Date and Time when PointcloudFigure was modified last. Date Format: Year:Month:Day:Hour:Minute:Seconds. Example: ‘2021-01-22T19:37:50.158Z’.
- created_at : str, optional¶
Date and Time when PointcloudFigure was created. Date Format is the same as in “updated_at” parameter.
- parent_object=
- Returns:
Pointcloud figure object.
- Return type:
- Usage Example:
import supervisely as sly from supervisely.geometry.cuboid_3d import Cuboid3d, Vector3d obj_class_car = sly.ObjClass('car', Cuboid3d) pointcloud_obj_car = sly.PointcloudObject(obj_class_car) position, rotation, dimension = Vector3d(-3.4, 28.9, -0.7), Vector3d(0., 0, -0.03), Vector3d(1.8, 3.9, 1.6) cuboid = Cuboid3d(position, rotation, dimension) frame_index = 10 figure = sly.PointcloudFigure(pointcloud_obj_car, cuboid, frame_index=frame_index) # Remember that PointcloudFigure object is immutable, and we need to assign new instance of PointcloudFigure to a new variable pointcloud_figure_clone = figure.clone(parent_object=pointcloud_obj_car, frame_index=11) print(pointcloud_figure_clone.to_json()) # Output: { # "geometry": { # "dimensions": { "x": 1.8, "y": 3.9, "z": 1.6 }, # "position": { "x": -3.4, "y": 28.9, "z": -0.7 }, # "rotation": { "x": 0.0, "y": 0, "z": -0.03 } # }, # "geometryType": "cuboid_3d", # "key": "4beae1be12624b70ad533c8be7477605", # "objectKey": "c1e1965efc0d4ae9b0b39367b04d637a" # }
- get_meta()¶
Get metadata for the video figure.
- Returns:
Dictionary with metadata for the video figure.
- Return type:
- Usage Example:
import supervisely as sly obj_class_car = sly.ObjClass('car', sly.Rectangle) video_obj_car = sly.VideoObject(obj_class_car) fr_index = 7 geometry = sly.Rectangle(0, 0, 100, 100) video_figure_car = sly.VideoFigure(video_obj_car, geometry, fr_index) print(video_figure_car.get_meta()) # {'frame': 7}
- key()¶
Figure key.
- Returns:
Figure key.
- Return type:
UUID
- Usage Example:
key = video_figure_car.key print(key) # 158e6cf4f4ac4c639fc6994aad127c16
-
to_json(key_id_map=
None, save_meta=False)¶ Convert the VideoFigure to a json dict. Read more about Supervisely format.
- Parameters:
- Returns:
Json format as a dict
- Return type:
Dict
- Usage Example:
import supervisely as sly obj_class_car = sly.ObjClass('car', sly.Rectangle) video_obj_car = sly.VideoObject(obj_class_car) fr_index = 7 geometry = sly.Rectangle(0, 0, 100, 100) video_figure_car = sly.VideoFigure(video_obj_car, geometry, fr_index) video_figure_json = video_figure_car.to_json(save_meta=True) print(video_figure_json) # Output: { # "key": "591d0511ba28462c8cd657691743359c", # "objectKey": "e061bc50bd464c23a008b712d195570a", # "geometryType": "rectangle", # "geometry": { # "points": { # "exterior": [ # [ # 0, # 0 # ], # [ # 100, # 100 # ] # ], # "interior": [] # } # }, # "meta": {"frame": 7}, # "nnCreated": false, # "nnUpdated": false # }
-
validate_bounds(img_size, _auto_correct=
False)[source]¶ Not supported for pointcloud.
- property frame_index : int¶
Frame index of the current VideoFigure.
- Returns:
Index of Frame to which VideoFigure belongs
- Return type:
- Usage Example:
fr_index = video_figure_car.frame_index print(fr_index) # 7
- property geometry : supervisely.geometry.geometry.Geometry¶
Geometry of the current VideoFigure.
- Returns:
Geometry object
- Return type:
- Usage Example:
geometry = video_figure_car.geometry print(geometry.to_json()) # Output: { # "points": { # "exterior": [ # [ # 0, # 0 # ], # [ # 100, # 100 # ] # ], # "interior": [] # } # }
- property parent_object : supervisely.pointcloud_annotation.pointcloud_object.PointcloudObject | supervisely.pointcloud_annotation.pointcloud_episode_object.PointcloudEpisodeObject¶
PointcloudObject of current PointcloudFigure.
- Returns:
Pointcloud object or pointcloud episode object.
- Return type:
PointcloudObjectorPointcloudEpisodeObject- Usage Example:
pointcloud_obj_car = pointcloud_figure_car.parent_object print(pointcloud_obj_car.to_json()) # Output: { # "key": "d573c6f081544e3da20022d932b259c1", # "classTitle": "car", # "tags": [] # }
- property priority¶
Priority of the figure (position of the figure relative to other overlapping or underlying figures).
- property smart_tool_input¶
Smart Tool parameters that were used for labeling.
Example:
- {
‘crop’: [[85.69912274538524, 323.07711452375236], [1108.5635719011857, 1543.1199742240174]], ‘visible’: True, ‘negative’: [], ‘positive’: [[597, 933], [474.5072466934964, 1381.6437133813354]]
}
- property status : supervisely.annotation.label.LabelingStatus¶
Labeling status. Specifies if the VideoFigure was created by NN model, manually or created by NN and then manually corrected.