Skip to content

Commit a83d1a3

Browse files
authoredDec 30, 2024
Merge pull request #534 from maxxgx/patch-2
CVS-159908 - Fix empty label ID in configuration [develop]
2 parents 33b1c90 + 5ccef0d commit a83d1a3

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed
 

‎geti_sdk/deployment/predictions_postprocessing/results_converter/results_to_prediction_converter.py

+6-4
Original file line numberDiff line numberDiff line change
@@ -175,12 +175,14 @@ def __init__(
175175
self.confidence_threshold = configuration["confidence_threshold"]
176176
if "label_ids" in configuration:
177177
# Make sure the list of labels is sorted according to the order
178-
# defined in the ModelAPI configuration. If the 'label_ids' field
179-
# only contains a single label, it will be typed as string. No need
180-
# to sort in that case
178+
# defined in the ModelAPI configuration.
179+
# - If the 'label_ids' field only contains a single label,
180+
# it will be typed as string. No need to sort in that case.
181+
# - Filter out the empty label ID, as it is managed separately by the base converter class.
181182
ids = configuration["label_ids"]
182183
if not isinstance(ids, str):
183-
self.labels.sort_by_ids(configuration["label_ids"])
184+
ids = [id_ for id_ in ids if id_ != self.empty_label.id]
185+
self.labels.sort_by_ids(ids)
184186

185187
def _detection2array(self, detections: List[Detection]) -> np.ndarray:
186188
"""

0 commit comments

Comments
 (0)
Please sign in to comment.