Skip to content

Commit

Permalink
Fix arrow format reader for multiclass ROI case (#4145)
Browse files Browse the repository at this point in the history
Fix arrow format reader for multiclass roi case
  • Loading branch information
sovrasov authored Dec 5, 2024
1 parent 1608d9b commit d9a3cd8
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 d9a3cd8

Please sign in to comment.