-
Notifications
You must be signed in to change notification settings - Fork 884
Object Detection Label Errors Argument Shape Difficulty #1200
Description
I posted in the cleanlab community Slack #help channel a few days ago, but figured I should also open an issue since I haven't seen any replies. I'm working with an object detection dataset and facing some challenges with constructing the inputs for cleanlab.object_detection.filter.find_label_issues.
My understanding from the docs regarding the inputs, but maybe I have this wrong:
- ground truth labels, are in a list of dictionaries
list[dict]with keys["bboxes", "labels"]both of which are Numpy arrays - predictions input is a
list[np.ndarray]with(D, K, 1, 5)dimensions (Dis detections per image,Kis the number of classes, 1 entry per class,[xmin, ymin, xmax, ymax, conf])
Example data (368 classes):
gt = [
{
'bboxes':
array([[0.055833, 0.318125, 0.916667, 0.964375],
[0.204167, 0.325 , 0.771667, 0.98 ],
[0.220833, 0.38625 , 0.776667, 0.91875 ],
[0. , 0.430625, 0.999167, 0.999375]]),
'labels':
array([[ 91],
[226],
[ -1],
[ 69]])
}
]
det = np.array(
[ # [class index, xmin, ymin, xmax, ymax, conf]
[2.26000000e+02, 2.18217492e-01, 3.70962501e-01, 7.79024482e-01, 9.99999523e-01, 6.29037023e-01],
[6.90000000e+01, 7.95739472e-01, 6.41192496e-01, 9.99720514e-01, 9.84477460e-01, 3.43284994e-01],
[9.10000000e+01, 2.08500028e-03, 4.19329971e-01, 6.62768960e-01, 9.96745944e-01, 5.77416003e-01]
],
)
# code to translate "det" into "preds" with shape (3, 368, 1, 5)
result = cleanlab.object_detection.filter.find_label_issues(gt, [preds])From the example/tutorial, it looks like the array should be (3, 368, 0, 5) but I'm a bit confused by the preds to be compatible, but I either end up with an IndexError or an AttributeError. I haven't had the time/opportunity to delve into or debug the source code, but I'm hoping that maybe I'm missing something obvious that someone can help point out. Much appreciated