Skip to content

Commit

Permalink
Update iseg empty label handling
Browse files Browse the repository at this point in the history
  • Loading branch information
sovrasov committed Dec 19, 2024
1 parent a78ccbb commit 3b6e7ec
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/otx/core/model/instance_segmentation.py
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,7 @@ def _export_parameters(self) -> TaskLevelExportParameters:
modified_label_info = copy.deepcopy(self.label_info)
# Instance segmentation needs to add empty label to satisfy MAPI wrapper requirements
modified_label_info.label_names.insert(0, "otx_empty_lbl")
modified_label_info.label_ids.insert(0, "None")

return super()._export_parameters.wrap(
model_type="MaskRCNN",
Expand Down Expand Up @@ -773,6 +774,7 @@ def _create_label_info_from_ov_ir(self) -> LabelInfo:
# workaround to hide extra otx_empty_lbl
if ir_label_info.label_names[0] == "otx_empty_lbl":
ir_label_info.label_names.pop(0)
ir_label_info.label_ids.pop(0)
ir_label_info.label_groups[0].pop(0)
return ir_label_info

Expand Down

0 comments on commit 3b6e7ec

Please sign in to comment.