I have a list of coordinates [xmin, xmax, ymin, ymax] on a list: [[xmin_a, xmax_a, ymin_a, ymax_a], [xmin_b, xmax_b, ymin_b, ymax_b]] and I want to remove the best result. For example, the [xmin_b, xmax_b, ymin_b, ymax_b]. For this, I tried using the listname.index() function but it returns 0. Through some prints I can tell the element is there, what is wrong with my code?
screenshot of the print evidence
This is the code excert that is troubled:
#Loop for each ground truth object compare with all the detections
for obj in groundtruth:
print('\t',obj)
max_iou = 0
for det in detectedlines:
print('\t>',det)
iou = calc_iou(obj, det, img_width, img_height)
if (iou > max_iou):
max_iou = iou
det_store = det
#removes the pred box with the best IoU from list
index_det = detectedlines.index(det_store)
print(index_det)
print(det_store)
print(detectedlines)
detectedlines.remove(index_det)
print(detectedlines)