Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error in iou__batches #161

Open
day-night-py opened this issue Jul 29, 2022 · 8 comments
Open

error in iou__batches #161

day-night-py opened this issue Jul 29, 2022 · 8 comments

Comments

@day-night-py
Copy link

yy1 = np.maximum(bb_test[..., 1], bb_gt[..., 1])
IndexError: index 1 is out of bounds for axis 1 with size 1

xx1 = np.maximum(bb_test[..., 0], bb_gt[..., 0])
ValueError: operands could not be broadcast together with shapes (0,) (1,2)

getting these two error while running

@marunava21
Copy link

I am also getting similar issue
were you able to resolve it?
' xx1 = np.maximum(bb_test[..., 0], bb_gt[..., 0])', 'ValueError: operands could not be broadcast together with shapes (0,) (1,32)

@sauravns
Copy link

@marunava21 @day-night-py check the detections you're passing to tracker, even if there are no detections just pass "np.empty((0, 5))".

@marunava21
Copy link

@sauravns Thanks for the suggestion, i solved the issue

@MihirD002
Copy link

@sauravns Thanks for the suggestion, i solved the issue

How did you solve the error, can you please explain?
I'm facing the same error.

@sbieee
Copy link

sbieee commented Jan 18, 2024

I am also getting similar error. Any idea what could be the issue?

File "/home/ubuntu/PycharmProjects/sort/sort.py", line 238, in update
matched, unmatched_dets, unmatched_trks = associate_detections_to_trackers(dets, trks, self.iou_threshold)
File "/home/ubuntu/PycharmProjects/sort/sort.py", line 169, in associate_detections_to_trackers
iou_matrix = iou_batch(detections, trackers)
File "/home/ubuntu/PycharmProjects/sort/sort.py", line 56, in iou_batch
xx1 = np.maximum(bb_test[..., 0], bb_gt[..., 0])
ValueError: operands could not be broadcast together with shapes (0,) (1,2)

@sbieee
Copy link

sbieee commented Jan 18, 2024

Thanks @sauravns for the suggestion.. In the iou_batch() function, we should check whether detection length and if its 0 then set the detection to empty numpy array,

def iou_batch(bb_test, bb_gt):
"""
From SORT: Computes IOU between two bboxes in the form [x1,y1,x2,y2]
"""

if len(bb_test) == 0:
    bb_test = np.empty((0, 5))

...
...

@ZXStudio
Copy link

谢谢@sauravns对于建议..在iou_batch()函数中,我们应该检查检测长度是否为0,然后将检测设置为空numpy数组,

def iou_batch(bb_test, bb_gt): """ 来自 SORT:以 [x1,y1,x2,y2] 形式计算两个 bbox 之间的 IOU """

if len(bb_test) == 0:
    bb_test = np.empty((0, 5))

……​

Thank you!!

@daonam2202ntg
Copy link

I got this error while running, please help me

yy1 = np.maximum(bb_test[..., 1], bb_gt[..., 1])
IndexError: index 1 is out of bounds for axis 1 with size 1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants