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

Can't parse 'pt1'. Sequence item with index 0 has a wrong type #48

Open
julvanu opened this issue Jun 16, 2022 · 5 comments
Open

Can't parse 'pt1'. Sequence item with index 0 has a wrong type #48

julvanu opened this issue Jun 16, 2022 · 5 comments

Comments

@julvanu
Copy link

julvanu commented Jun 16, 2022

Bug in src/data_process/kitti_bev_utils.py; function drawRotatedBox(); line 168

I had to cast every one of these values from "corners_int" variable to int as there were actually floats. cv2.line() then raised an Exception.

image

cv2.line(img, (corners_int[0, 0], corners_int[0, 1]), (corners_int[3, 0], corners_int[3, 1]), (255, 255, 0), 2)
changed to:
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)

This error occurred whenever I tried to execute:
python kitti_dataloader.py --show-train-data --cutout_prob 1. --cutout_nholes 1 --cutout_fill_value 1. --cutout_ratio 0.3 --output-width 608

@julvanu julvanu changed the title Bug in src/data_process/kitti_bev_utils.py; function drawRotatedBox(); line 168 Can't parse 'pt1'. Sequence item with index 0 has a wrong type Jun 16, 2022
@tanay-o
Copy link

tanay-o commented Aug 4, 2022

same issue, did you find a fix for this yet @julvanu?

@julvanu
Copy link
Author

julvanu commented Aug 4, 2022

same issue, did you find a fix for this yet @julvanu?

As written in the initial post, I changed the cv2.line() call, casting every corners_int parameter to int

@tanay-o
Copy link

tanay-o commented Aug 4, 2022

That fixed it. Tysm. I skimmed through that part, my bad.

@julvanu
Copy link
Author

julvanu commented Aug 4, 2022

No problem, glad to help :)

@AbdullahJirjees
Copy link

Hello,

I changed the corners_int to int and I got new error

kitti_bev_utils.py", line 168, in drawRotatedBox
cv2.line(img, (int[0, 0], int[0, 1]), (int[3, 0], int[3, 1]), (255, 255, 0), 2)
TypeError: 'type' object is not subscriptable

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

3 participants