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

Better string representation for IQ result #165

Open
robotrapta opened this issue Feb 12, 2024 · 0 comments
Open

Better string representation for IQ result #165

robotrapta opened this issue Feb 12, 2024 · 0 comments

Comments

@robotrapta
Copy link
Member

robotrapta commented Feb 12, 2024

Currently if you try to print out an image-query result you get back from the SDK like this:

result = gl.ask_ml(detector, frame)
print(result)

You get something pretty nasty to read like this:

id='iq_2cHNunx4LvBid4lnEJrYKNbR' type=<ImageQueryTypeEnum.image_query: 'image_query'>
created_at=datetime.datetime(2024, 2, 12, 19, 6, 8, 889722, tzinfo=tzutc()) query='Is the door open?'
detector_id='det_2cHEfNOgWSsavUE4JIgM6BtE' result_type=<ResultTypeEnum.binary_classification:
'binary_classification'> result=ClassificationResult(confidence=0.8437289317084585, label=<Label.NO: 
'NO'>) metadata=None

Most of the time if somebody is printing this, they probably want to see the label and confidence, so those should be at the front much easier to find. A bunch can probably be simplified out.

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

1 participant