@@ -45,17 +45,17 @@ def append_occlusion(self, occlusion: Mask, name: str = None):
45
45
If none, the occlusion mask will be attached without name (if possible). Otherwise if no other unnamed
46
46
occlusion mask are attached to the frame, the mask will be added to the set of mask.
47
47
"""
48
- self ._append_label ("occlusion" , occlusion , name )
48
+ self ._append_child ("occlusion" , occlusion , name )
49
49
50
- def __get_view__ (self , cmap = "nipy_spectral" , min_depth = 0 , max_depth = 200 ):
50
+ def __get_view__ (self , cmap = "nipy_spectral" , min_depth = 0 , max_depth = 200 , title = None ):
51
51
assert all (dim not in self .names for dim in ["B" , "T" ]), "Depth should not have batch or time dimension"
52
52
cmap = matplotlib .cm .get_cmap (cmap )
53
53
depth = self .rename (None ).permute ([1 , 2 , 0 ]).detach ().cpu ().contiguous ().numpy ()
54
54
55
55
depth = max_depth - np .clip (depth , min_depth , max_depth )
56
56
depth = matplotlib .colors .Normalize (vmax = max_depth )(depth )
57
57
depth_color = cmap (depth )[:, :, 0 , :3 ]
58
- return View (depth_color )
58
+ return View (depth_color , title = title )
59
59
60
60
def as_points3d (self , camera_intrinsic : aloscene .CameraIntrinsic = None ):
61
61
"""Compute the 3D coordinates of points 2D points based on their respective depth.
0 commit comments