|
6 | 6 |
|
7 | 7 | import aloscene
|
8 | 8 | from aloscene.renderer import View
|
9 |
| -from aloscene import BoundingBoxes2D, BoundingBoxes3D, Depth, Disparity, Flow, Mask, Labels, Points2D, Points3D, Pose |
| 9 | +from aloscene import ( |
| 10 | + BoundingBoxes2D, |
| 11 | + BoundingBoxes3D, |
| 12 | + Depth, |
| 13 | + Disparity, |
| 14 | + Flow, |
| 15 | + Mask, |
| 16 | + Labels, |
| 17 | + Points2D, |
| 18 | + Points3D, |
| 19 | + Pose, |
| 20 | + SceneFlow, |
| 21 | +) |
10 | 22 |
|
11 | 23 | # from aloscene.camera_calib import CameraExtrinsic, CameraIntrinsic
|
12 | 24 | from aloscene.io.image import load_image
|
@@ -114,6 +126,7 @@ def __new__(
|
114 | 126 | tensor.add_child("segmentation", segmentation, align_dim=["B", "T"], mergeable=False)
|
115 | 127 | tensor.add_child("labels", labels, align_dim=["B", "T"], mergeable=True)
|
116 | 128 | tensor.add_child("pose", labels, align_dim=["B", "T"], mergeable=True)
|
| 129 | + tensor.add_child("scene_flow", labels, align_dim=["B", "T"], mergeable=False) |
117 | 130 |
|
118 | 131 | # Add other tensor property
|
119 | 132 | tensor.add_property("normalization", normalization)
|
@@ -318,6 +331,25 @@ def append_pose(self, pose: Pose, name: str = None):
|
318 | 331 | """
|
319 | 332 | self._append_child("pose", pose, name)
|
320 | 333 |
|
| 334 | + def append_scene_flow(self, scene_flow: SceneFlow, name: str = None): |
| 335 | + """Attach a scene flow to the frame. |
| 336 | +
|
| 337 | + Parameters |
| 338 | + ---------- |
| 339 | + scene_flow : :mod:`SceneFlow <aloscene.SceneFlow>` |
| 340 | + Depth to attach to the Frame |
| 341 | + name : str |
| 342 | + If none, the scene flow will be attached without name (if possible). Otherwise if no other unnamed |
| 343 | + scene flow is attached to the frame, the scene flow will be added to the set of scene flows. |
| 344 | +
|
| 345 | + Examples |
| 346 | + -------- |
| 347 | + >>> frame = aloscene.Frame("/path/to/image.jpeg") |
| 348 | + >>> scene_flow = aloscene.SceneFlow(np.random.rand((3, frame.H, frame.W))) |
| 349 | + >>> frame.append_scene_flow(scene_flow) |
| 350 | + """ |
| 351 | + self._append_child("scene_flow", scene_flow, name) |
| 352 | + |
321 | 353 | @staticmethod
|
322 | 354 | def _get_mean_std_tensor(shape, names, mean_std: tuple, device="cpu"):
|
323 | 355 | """Utils method to a get the mean and the std
|
|
0 commit comments