-
Notifications
You must be signed in to change notification settings - Fork 6
Pil image support. Default WAIT #31
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
does the ndarray type detection work if you pass an OpenCV frame or do you have to cast it ?
src/groundlight/client.py
Outdated
| def submit_image_query( | ||
| self, | ||
| detector: Union[Detector, str], | ||
| image: Union[str, bytes, BytesIO, BufferedReader, np.ndarray], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: add Image.Image to the supported input types
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch!
tyler-romero
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, just a couple nits
Unfortunately, I think the answer is that it "almost works". I think what will happen is that we will accept the image, but the colors will be wrong because OpenCV uses BGR order for color-channel, but we expect RGB. This is certainly not awesome. If we're getting an image as a numpy array, it's very likely it came from OpenCV. Maybe we should require images to be BGR. That change would be backwards incompatible though. Filed #34 to track this. |
You can now submit imagequeries with PIL images. But obviously only if PIL is installed. Fixes #22
Also you can set
gl.DEFAULT_WAITwhich overrides the default 30 for all submit-image-query calls.