Skip to content

Commit ff367a2

Browse files
authored
Merge pull request #514 from openvinotoolkit/fix-instance-segmentation-label-id-parsing
Fix empty label assignment for instance segmentation models
2 parents e56c195 + be64892 commit ff367a2

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

geti_sdk/data_models/containers/label_list.py

+6
Original file line numberDiff line numberDiff line change
@@ -124,5 +124,11 @@ def sort_by_ids(self, label_ids: List[str]):
124124
"""
125125
new_data: List[Label] = []
126126
for label_id in label_ids:
127+
if label_id is None:
128+
# Certain models have the label id as 'None' to signal an empty label
129+
if self.get_empty_label() is not None:
130+
new_data.append(self.get_empty_label())
131+
else:
132+
continue
127133
new_data.append(self.get_by_id(label_id))
128134
self.data = new_data

geti_sdk/deployment/deployed_model.py

+3
Original file line numberDiff line numberDiff line change
@@ -764,6 +764,9 @@ def get_model_config(self) -> Dict[str, Any]:
764764
value = value.split(" ")
765765
value_list = []
766766
for item in value:
767+
if isinstance(item, str) and item.lower() == "none":
768+
value_list.append(None)
769+
continue
767770
try:
768771
value_list.append(float(item))
769772
except ValueError:

0 commit comments

Comments
 (0)