Skip to content

Formatting Object Detection Labels - Multiple Predictions but Empty Labels #1234

Description

@jeethesh-pai

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

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.

    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

No activity

Activity on this issue will appear here.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions