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

Add Vision Client #2179

Merged
merged 2 commits into from
Aug 29, 2016
Merged

Add Vision Client #2179

merged 2 commits into from
Aug 29, 2016

Conversation

daspecster
Copy link
Contributor

Areas of focus:

This PR is a bit large, but it's mostly due to vision/fixtures.py which I would like your feedback on.

The image source passed into the client will eventually be able to be a raw string/byte stream of the image, a gs://bucket/image.jpg or a URL to be downloaded via httplib2.

VisionJSONEncoder is probably a topic of debate.

VisionRequest should probably be in it's own file or I suppose it's functionality could be absorbed by Client. I'm not sure the best path there.

LMKWYT!

@daspecster daspecster added the api: vision Issues related to the Cloud Vision API. label Aug 24, 2016
@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Aug 24, 2016
@dhermes
Copy link
Contributor

dhermes commented Aug 24, 2016

WIthout even looking, a custom json encoder seems like big time overkil (and may even be a performance hit).

@daspecster
Copy link
Contributor Author

Ok, I'll see if I can do without the JSON encoder.

PROJECT = 'PROJECT'
IMAGE_SOURCE = 'gs://some/image.jpg'
IMAGE_CONTENT = '/9j/4QNURXhpZgAASUkq'
B64_IMAGE_CONTENT = base64.b64encode(IMAGE_CONTENT)

This comment was marked as spam.

@tseaver
Copy link
Contributor

tseaver commented Aug 25, 2016

gcloud.vision.test_image is missing.

return self._getTargetClass()(*args, **kw)

def test_make_vision_request(self):
IMAGE_CONTENT = '/9j/4QNURXhpZgAASUkq'

This comment was marked as spam.

@daspecster
Copy link
Contributor Author

@tseaver, should I try and leave out image.py and try and test the client.py code with all just Mocks?

@tseaver
Copy link
Contributor

tseaver commented Aug 25, 2016

@daspecster the tests of the Client.image factory pretty much need to use the Image class: mocking it away doesn't win any clarity.

- Add more docstrings and corrections
- Add gcs_uri support
- Remove VisionEncoder
@daspecster
Copy link
Contributor Author

@dhermes @tseaver I think I addressed your comments from before. As soon as this is merged I'll get the face detection PR together.

@tseaver
Copy link
Contributor

tseaver commented Aug 29, 2016

LGTM

@daspecster
Copy link
Contributor Author

Thanks @tseaver!

@dhermes did you have anything else?

@dhermes
Copy link
Contributor

dhermes commented Aug 29, 2016

You don't need two reviewers. Feel free to merge.

@daspecster daspecster merged commit a678774 into googleapis:master Aug 29, 2016
@dhermes dhermes mentioned this pull request Sep 19, 2016
@daspecster daspecster deleted the vision-client branch January 24, 2017 15:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: vision Issues related to the Cloud Vision API. cla: yes This human has signed the Contributor License Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants