-
Notifications
You must be signed in to change notification settings - Fork 757
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
[DOC] add examples of query with requests for adapters #1202
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1202 +/- ##
=======================================
Coverage 65.98% 65.98%
=======================================
Files 135 135
Lines 8563 8563
=======================================
Hits 5650 5650
Misses 2913 2913
Continue to review full report at Codecov.
|
|
||
with open("test.jpg", "rb") as f: | ||
image_bytes = f.read() | ||
with open("anno.json", "rb") as f: |
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.
give the user an alternative to use some in-memory data as the JSON annotation data?
e.g.
annotations = { "age": 10, "bar": "foo" }
anno_bytes = json.dumps(annotations).encode()
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.
That is definitely helpful! I think in many cases the annotation part of the request is created at runtime and not read from file.
import requests | ||
|
||
with open("test.jpg", "rb") as f: | ||
image_bytes = f.read() |
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.
Similarly let's give the user another example to turn a PIL image object into a request?
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.
This is very helpful!
* [DOC] add examples of query with requests for adapters * add query example that post images from PIL Image
* [DOC] add examples of query with requests for adapters * add query example that post images from PIL Image
Description
As title.
Motivation and Context
#1201
How Has This Been Tested?
Types of changes
Component(s) if applicable
Checklist:
./dev/format.sh
and./dev/lint.sh
script have passed(instructions).