Object3D
2 minute read
Wandb class for 3D point clouds.
Object3D(
    data_or_path: Union['np.ndarray', str, 'TextIO', dict],
    **kwargs
) -> None
| Args | |
|---|---|
| data_or_path | (numpy array, string, io) Object3D can be initialized from a file or a numpy array. You can pass a path to a file or an io object and a file_type which must be one of SUPPORTED_TYPES | 
The shape of the numpy array must be one of either:
[[x y z],       ...] nx3
[[x y z c],     ...] nx4 where c is a category with supported range [1, 14]
[[x y z r g b], ...] nx6 where is rgb is color
Methods
from_file
@classmethod
from_file(
    data_or_path: Union['TextIO', str],
    file_type: Optional['FileFormat3D'] = None
) -> "Object3D"
Initializes Object3D from a file or stream.
| Args | |
|---|---|
| data_or_path (Union[“TextIO”, str]): A path to a file or a TextIOstream. file_type (str): Specifies the data format passed todata_or_path. Required whendata_or_pathis aTextIOstream. This parameter is ignored if a file path is provided. The type is taken from the file extension. | 
from_numpy
@classmethod
from_numpy(
    data: "np.ndarray"
) -> "Object3D"
Initializes Object3D from a numpy array.
| Args | |
|---|---|
| data (numpy array): Each entry in the array will represent one point in the point cloud. | 
The shape of the numpy array must be one of either:
[[x y z],       ...]  # nx3.
[[x y z c],     ...]  # nx4 where c is a category with supported range [1, 14].
[[x y z r g b], ...]  # nx6 where is rgb is color.
from_point_cloud
@classmethod
from_point_cloud(
    points: Sequence['Point'],
    boxes: Sequence['Box3D'],
    vectors: Optional[Sequence['Vector3D']] = None,
    point_cloud_type: "PointCloudType" = "lidar/beta"
) -> "Object3D"
Initializes Object3D from a python object.
| Args | |
|---|---|
| points (Sequence[“Point”]): The points in the point cloud. boxes (Sequence[“Box3D”]): 3D bounding boxes for labeling the point cloud. Boxes are displayed in point cloud visualizations. vectors (Optional[Sequence[“Vector3D”]]): Each vector is displayed in the point cloud visualization. Can be used to indicate directionality of bounding boxes. Defaults to None. point_cloud_type (“lidar/beta”): At this time, only the “lidar/beta” type is supported. Defaults to “lidar/beta”. | 
| Class Variables | |
|---|---|
| SUPPORTED_POINT_CLOUD_TYPES | |
| SUPPORTED_TYPES | 
Feedback
Was this page helpful?
Glad to hear it! Please tell us how we can improve.
Sorry to hear that. Please tell us how we can improve.