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

draw_bbox fails for grayscale images #806

Closed
lgvaz opened this issue Apr 19, 2021 · 3 comments · May be fixed by #807
Closed

draw_bbox fails for grayscale images #806

lgvaz opened this issue Apr 19, 2021 · 3 comments · May be fixed by #807
Labels
bug Something isn't working

Comments

@lgvaz
Copy link
Collaborator

lgvaz commented Apr 19, 2021

🐛 Bug

draw_data contains the line: img = PIL.Image.fromarray(img). If the image is grayscale and in the format (h,w,1) (which is what icevision expects` it fails with the error:

TypeError: Cannot handle this data type: (1, 1, 1), |u1

More info:
https://stackoverflow.com/questions/63367136/pil-typeerror-cannot-handle-this-data-type-1-1-1-u1

@lgvaz lgvaz added the bug Something isn't working label Apr 19, 2021
@lgvaz
Copy link
Collaborator Author

lgvaz commented Apr 19, 2021

It seems draw_masks and draw_keypoints also use this logic, so they will all fail

@lgvaz
Copy link
Collaborator Author

lgvaz commented Apr 19, 2021

in #807 i tried to squeeze the images into two channels - it works, but now the error has moved somewhere else, it complains because we're trying to draw a colored bbox into a grayscale image

https://stackoverflow.com/a/42322058/6772672

@FraPochetti
Copy link
Contributor

Not relevant anymore.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants