Skip to content

Commit

Permalink
Fix arrow format reader for multiclass roi case
Browse files Browse the repository at this point in the history
  • Loading branch information
sovrasov committed Dec 4, 2024
1 parent 5d6f8d3 commit 57c47bf
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/otx/core/data/dataset/classification.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,10 @@ def _get_item_impl(self, index: int) -> MulticlassClsDataEntity | None:
labels_ids = [
label["label"]["_id"] for label in roi["labels"] if label["label"]["domain"] == "CLASSIFICATION"
]
label_anns = [self.label_info.label_names.index(label_id) for label_id in labels_ids]
if self.data_format == "arrow":
label_anns = [self.label_info.label_ids.index(label_id) for label_id in labels_ids]
else:
label_anns = [self.label_info.label_names.index(label_id) for label_id in labels_ids]
else:
# extract labels from annotations
label_anns = [ann.label for ann in item.annotations if isinstance(ann, Label)]
Expand Down

0 comments on commit 57c47bf

Please sign in to comment.