cleanlab / cleanlab/cleanlab

Formatting Object Detection Labels - Multiple Predictions but Empty Labels

Open
#1,234 1 comment 0 reactions 1 assignee Claimed by @aditya1503 View on GitHub
needs triage
Dominant language
Python
Stars
11.7k
Forks
920
PR merge metrics
No merged PRs in 30d

Description

Hi CleanLab team,

Thanks a lot for this repo. I would like to know how should we format the Object detection label for label error detection in cleanlab.

![Image](https://github.com/user-attachments/assets/3bf61873-58af-4c80-9538-e9a5070c82ba)

According to tutorial, it is just mentioned that the labels[i] should be a dictionary with "labels" and "bboxes" as keys. How should we handle the case for no label images. Image with just background. I am getting an error because of this issue.

```bash
label_issue_idx = find_label_issues(labels, predictions, return_indices_ranked_by_score=True)
File "/usr/local/lib/python3.8/dist-packages/cleanlab/object_detection/filter.py", line 115, in find_label_issues
is_issue = _find_label_issues(
File "/usr/local/lib/python3.8/dist-packages/cleanlab/object_detection/filter.py", line 138, in _find_label_issues
per_class_scores = _get_per_class_ap(labels, predictions)
File "/usr/local/lib/python3.8/dist-packages/cleanlab/object_detection/filter.py", line 398, in _get_per_class_ap
ap_per_class = _calculate_ap_per_class(labels, predictions, iou_threshold=threshold)
File "/usr/local/lib/python3.8/dist-packages/cleanlab/object_detection/filter.py", line 275, in _calculate_ap_per_class
pred_bboxes, lab_bboxes = _filter_by_class(labels, predictions, class_num)
File "/usr/local/lib/python3.8/dist-packages/cleanlab/object_detection/filter.py", line 317, in _filter_by_class
lab_bboxes.append(label["bboxes"][gt_inds, :])
IndexError: too many indices for array: array is 1-dimensional, but 2 were indexed
```

This error arises because some of images have empty labels (just background) and labels looks like this,
`label = {"label": array([]), "bboxes": array([])}`

Any help regarding the same would be greatly appreciated.

Thanks and regards
Jeethesh

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.