maudzung / Complex-YOLOv4-Pytorch

The PyTorch Implementation based on YOLOv4 of the paper: "Complex-YOLO: Real-time 3D Object Detection on Point Clouds"
https://arxiv.org/pdf/1803.06199.pdf
GNU General Public License v3.0
1.24k stars 256 forks source link

cv2.line error #67

Open Huxwell opened 1 year ago

Huxwell commented 1 year ago

When running python kitti_dataloader.py --output-width 608 I get

Traceback (most recent call last):
  File "kitti_dataloader.py", line 163, in <module>
    bev_utils.drawRotatedBox(img_bev, x, y, w, l, yaw, cnf.colors[int(c)])
  File "/home/user/Complex-YOLOv4-Pytorch/src/data_process/../data_process/kitti_bev_utils.py", line 171, in drawRotatedBox
    cv2.line(img, (corners_int[0, 0], corners_int[0, 1]), (corners_int[3, 0], corners_int[3, 1]), (255, 255, 0), 2)
cv2.error: OpenCV(4.5.3) :-1: error: (-5:Bad argument) in function 'line'
> Overload resolution failed:
>  - Can't parse 'pt1'. Sequence item with index 0 has a wrong type
>  - Can't parse 'pt1'. Sequence item with index 0 has a wrong type

The solution seems to be adding .astype(int) in L167 of kitti_bev_utils.py. The int conversion is run at L165, but then discarded in L167.

Huxwell commented 1 year ago

https://github.com/maudzung/Complex-YOLOv4-Pytorch/pull/68 pr submitted

AbdullahJirjees commented 6 months ago

Hello,

I am having your same issue, did you got to a solution?

mahdikhashan commented 5 months ago

@Huxwell I used your solution and it fixed the code.