Skip to content

Commit

Permalink
Merge pull request #514 from openvinotoolkit/fix-instance-segmentatio…
Browse files Browse the repository at this point in the history
…n-label-id-parsing

Fix empty label assignment for instance segmentation models
  • Loading branch information
ljcornel authored Oct 29, 2024
2 parents e56c195 + be64892 commit ff367a2
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
6 changes: 6 additions & 0 deletions geti_sdk/data_models/containers/label_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,5 +124,11 @@ def sort_by_ids(self, label_ids: List[str]):
"""
new_data: List[Label] = []
for label_id in label_ids:
if label_id is None:
# Certain models have the label id as 'None' to signal an empty label
if self.get_empty_label() is not None:
new_data.append(self.get_empty_label())
else:
continue
new_data.append(self.get_by_id(label_id))
self.data = new_data
3 changes: 3 additions & 0 deletions geti_sdk/deployment/deployed_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -764,6 +764,9 @@ def get_model_config(self) -> Dict[str, Any]:
value = value.split(" ")
value_list = []
for item in value:
if isinstance(item, str) and item.lower() == "none":
value_list.append(None)
continue
try:
value_list.append(float(item))
except ValueError:
Expand Down

0 comments on commit ff367a2

Please sign in to comment.