Skip to content

Commit

Permalink
fix(viewer): resolve segmentation rendering mistakes (#82)
Browse files Browse the repository at this point in the history
* fix: resolve apeending wrong value to uuids

Signed-off-by: ktro2828 <[email protected]>

* fix: set the value of background to -1

Signed-off-by: ktro2828 <[email protected]>

---------

Signed-off-by: ktro2828 <[email protected]>
  • Loading branch information
ktro2828 authored Dec 28, 2024
1 parent 91df6a1 commit 941c7ae
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion t4_devkit/tier4.py
Original file line number Diff line number Diff line change
Expand Up @@ -1239,5 +1239,5 @@ def _append_mask(
camera_masks[camera] = {}
camera_masks[camera]["masks"] = [ann.mask.decode()]
camera_masks[camera]["class_ids"] = [class_id]
camera_masks[camera]["uuids"] = [class_id]
camera_masks[camera]["uuids"] = [uuid]
return camera_masks
2 changes: 1 addition & 1 deletion t4_devkit/viewer/rendering_data/segmentation.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def as_segmentation_image(self) -> rr.SegmentationImage:
TODO:
Add support of instance segmentation.
"""
image = np.zeros(self.size, dtype=np.uint8)
image = np.full(self.size, -1, dtype=np.int64)

for mask, class_id in zip(self.masks, self.class_ids, strict=True):
image[mask == 1] = class_id
Expand Down

0 comments on commit 941c7ae

Please sign in to comment.