deyiwang89 / pytorch-yolov4-deepsort

25 stars 7 forks source link

IndexError #6

Closed Kaiwen6 closed 3 years ago

Kaiwen6 commented 3 years ago

老哥好,这个项目我跑过了,在用你给的001.avi视频进行目标跟踪时能达到一个好的效果,但我换了别的视频时,就会报错,我试了好几个都是这样,你能看看是怎么回事吗? Traceback (most recent call last): File "D:/code/pytorch-yolov4-deepsort-main/yolov4_deepsort.py", line 173, in vdo_trk.run() File "D:/code/pytorch-yolov4-deepsort-main/yolov4_deepsort.py", line 128, in run outputs = self.deepsort.update(new_bbox, cls_conf, im) File "D:\code\pytorch-yolov4-deepsort-main\deep_sort\deep_sort.py", line 39, in update bbox_tlwh = self._xywh_to_tlwh(bbox_xywh) File "D:\code\pytorch-yolov4-deepsort-main\deep_sort\deep_sort.py", line 87, in _xywh_to_tlwh bbox_tlwh = np.zeros((bbox_xywh.shape[0],bbox_xywh.shape[1])) IndexError: tuple index out of range <class 'IndexError'> tuple index out of range <traceback object at 0x0000020B2F370888>

Kaiwen6 commented 3 years ago

通过调试我发现,跟踪的视频里必须要有检测器能检测的classes,否则检测器检测不到物体,传到deepsort就会报错,一定要注意根据你视频的种类修改yolov4_deepsort.py里面第107行mask = [”你视频的种类“]。