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

cv2 error #63

Open
didnmj opened this issue Jan 17, 2022 · 5 comments
Open

cv2 error #63

didnmj opened this issue Jan 17, 2022 · 5 comments

Comments

@didnmj
Copy link

didnmj commented Jan 17, 2022

joon@DESKTOP-J3EB27K:~/Complex-YOLOv3$ python test_both_side_detection.py --split=sample --folder=sampledata --save_video=true
Namespace(class_path='data/classes.names', conf_thres=0.8, folder='sampledata', img_size=608, model_def='config/complex_yolov3.cfg', nms_thres=0.4, save_video=True, split='sample', weights_path='checkpoints/yolov3_ckpt_epoch-298.pth')
Load TESTING samples from data/KITTI/object/sampledata
Done: total TESTING samples 12
Traceback (most recent call last):
File "test_both_side_detection.py", line 90, in
front_bev_result, img_detections = detect_and_draw(model, front_bevs, Tensor, True)
File "test_both_side_detection.py", line 51, in detect_and_draw
bev_utils.drawRotatedBox(display_bev, x, y, w, l, yaw, cnf.colors[int(cls_pred)])
File "/home/joon/Complex-YOLOv3/utils/kitti_bev_utils.py", line 174, 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.5) 👎 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
@didnmj
Copy link
Author

didnmj commented Jan 17, 2022

kitti_bev_utils.py line 169 ~ 174
//////////////////////////////////////
def drawRotatedBox(img,x,y,w,l,yaw,color):
bev_corners = get_corners(x, y, w, l, yaw)
corners_int = bev_corners.reshape(-1, 1, 2).astype(int)
cv2.polylines(img, [corners_int], True, color, 2)
corners_int = bev_corners.reshape(-1, 2)
cv2.line(img, (corners_int[0, 0], corners_int[0, 1]), (corners_int[3, 0], corners_int[3, 1]), (255, 255, 0), 2)

@Shibaditya99
Copy link

following

@sjkaang
Copy link

sjkaang commented Mar 25, 2022

I have the same problem.. Have you solved it?

1 similar comment
@sunny553
Copy link

I have the same problem.. Have you solved it?

@sjkaang
Copy link

sjkaang commented Mar 30, 2022

I have the same problem.. Have you solved it?

I have solved this. Change as below

kitti_bev_utils.py line 174
///////////////////////////////////
cv2.line(img, (int(corners_int[0, 0]), int(corners_int[0, 1])), (int(corners_int[3, 0]), int(corners_int[3, 1])), (255, 255, 0), 2)

But I'm not sure why 'astype' didn't work in line 171 >>> "corners_int = bev_corners.reshape(-1, 1, 2).astype(int)"

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

4 participants