Skip to content

Commit d9a3cd8

Browse files
authored
Fix arrow format reader for multiclass ROI case (#4145)
Fix arrow format reader for multiclass roi case
1 parent 1608d9b commit d9a3cd8

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/otx/core/data/dataset/classification.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,10 @@ def _get_item_impl(self, index: int) -> MulticlassClsDataEntity | None:
3939
labels_ids = [
4040
label["label"]["_id"] for label in roi["labels"] if label["label"]["domain"] == "CLASSIFICATION"
4141
]
42-
label_anns = [self.label_info.label_names.index(label_id) for label_id in labels_ids]
42+
if self.data_format == "arrow":
43+
label_anns = [self.label_info.label_ids.index(label_id) for label_id in labels_ids]
44+
else:
45+
label_anns = [self.label_info.label_names.index(label_id) for label_id in labels_ids]
4346
else:
4447
# extract labels from annotations
4548
label_anns = [ann.label for ann in item.annotations if isinstance(ann, Label)]

0 commit comments

Comments
 (0)