Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CVS-159908 - Fix empty label ID in configuration [develop] #534

Merged
merged 1 commit into from
Dec 30, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -175,12 +175,14 @@ def __init__(
self.confidence_threshold = configuration["confidence_threshold"]
if "label_ids" in configuration:
# Make sure the list of labels is sorted according to the order
# defined in the ModelAPI configuration. If the 'label_ids' field
# only contains a single label, it will be typed as string. No need
# to sort in that case
# defined in the ModelAPI configuration.
# - If the 'label_ids' field only contains a single label,
# it will be typed as string. No need to sort in that case.
# - Filter out the empty label ID, as it is managed separately by the base converter class.
ids = configuration["label_ids"]
if not isinstance(ids, str):
self.labels.sort_by_ids(configuration["label_ids"])
ids = [id_ for id_ in ids if id_ != self.empty_label.id]
self.labels.sort_by_ids(ids)

def _detection2array(self, detections: List[Detection]) -> np.ndarray:
"""
Expand Down
Loading