Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
eugene123tw committed Aug 22, 2024
1 parent 63d1984 commit 4a54779
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions model_api/python/model_api/models/instance_segmentation.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,11 +201,14 @@ def postprocess(self, outputs, meta):
confidence <= self.confidence_threshold and not has_feature_vector_name
):
continue
str_label = (
self.labels[cls]
if self.labels and cls < len(self.labels)
else f"#{cls}"
)

# Skip if label index is out of bounds
if self.labels and cls >= len(self.labels):
continue

# Get label string
str_label = self.labels[cls] if self.labels else f"#{cls}"

raw_cls_mask = raw_mask[cls, ...] if self.is_segmentoly else raw_mask
if self.postprocess_semantic_masks or has_feature_vector_name:
resized_mask = _segm_postprocess(
Expand Down

0 comments on commit 4a54779

Please sign in to comment.