-
Notifications
You must be signed in to change notification settings - Fork 6
Userguide updates #12
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
positavi
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.
see comments.
| def get_detector_by_name(self, name: str) -> Optional[Detector]: | ||
| #TODO: Do this on server. | ||
| detector_list = self.list_detectors(page_size=100) | ||
| for d in detector_list.results: |
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 this work if there are more than 100 detectors ?
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.
It does not. But it will complain instead of failing silently.
| image_query = gl.submit_image_query(detector=detector, image="path/to/filename.jpeg") | ||
| # Show the results | ||
| print(f"The answer is {image_query.result}") |
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.
should we expose confidence here? its actually a little tricky because when a human reviews it the confidence becomes None (!).
also, this only gets the ML answer, which can be total junk. if you want to wait for a definitive answer, you have to poll it. i don't know what we do to encourage good behavior there or if it matters if people just busy wait and poll.
i think we can expose the example here of how to check threshold, wait for a good enough answer. its kindof awesome and a really unique feature.
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.
Yeah, this does require more thought, and my initial thoughts are probably wrong.
Seems like there are multiple levels:
A. We can specify the confidence_threshold at detector creation (or update) time. Then, when a posicheck comes:
- we return a boolean on whether we are above the confidence_threshold
- or we return
Nonefor result if we're under-confident. If we are above the confidence threshold, or it comes from a human, we return non-Noneresult.
B. We add an optional polling_timeout argument to submit_image_query, and we do optionally do the polling inside that function on behalf of the user. We can also add an optional confidence_threshold parameter to submit_image_query() that overrides the detector-level config.
Not sure if we need these now, or should just include a second, more detailed example code. Handling varying confidences definitely makes things more complicated.
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.
I think we should do at least one of these things , but I'd rather put that in another PR.
positavi
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.
see comments
| image_query = gl.submit_image_query(detector=detector, image="path/to/filename.jpeg") | ||
| # Show the results | ||
| print(f"The answer is {image_query.result}") |
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.
Yeah, this does require more thought, and my initial thoughts are probably wrong.
Seems like there are multiple levels:
A. We can specify the confidence_threshold at detector creation (or update) time. Then, when a posicheck comes:
- we return a boolean on whether we are above the confidence_threshold
- or we return
Nonefor result if we're under-confident. If we are above the confidence threshold, or it comes from a human, we return non-Noneresult.
B. We add an optional polling_timeout argument to submit_image_query, and we do optionally do the polling inside that function on behalf of the user. We can also add an optional confidence_threshold parameter to submit_image_query() that overrides the detector-level config.
Not sure if we need these now, or should just include a second, more detailed example code. Handling varying confidences definitely makes things more complicated.
And a couple useful changes to the SDK.