Skip to content

Commit

Permalink
Fix confusion matrix calculation (#3857)
Browse files Browse the repository at this point in the history
* Fix confusion metrix calculation

* Update accuracy.py
  • Loading branch information
harimkang authored Aug 20, 2024
1 parent 34fdc7c commit e563f62
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/otx/api/usecases/evaluation/accuracy.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ def __get_gt_and_predicted_label_indices_from_resultset(
pred_dataset.sort_items()

# Iterate over each dataset item, and collect the labels for this item (pred and gt)
task_labels = resultset.model.configuration.get_label_schema().get_labels(include_empty=True)
task_labels = resultset.model.configuration.get_label_schema().get_labels(include_empty=False)
for gt_item, pred_item in zip(gt_dataset, pred_dataset):
if isinstance(gt_item, DatasetItemEntity) and isinstance(pred_item, DatasetItemEntity):
true_label_idx.append({task_labels.index(label) for label in gt_item.get_roi_labels(task_labels)})
Expand Down

0 comments on commit e563f62

Please sign in to comment.