-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Vision: Add gRPC support for safe search. #2938
Vision: Add gRPC support for safe search. #2938
Conversation
self.assertEqual(annotations.landmarks, []) | ||
self.assertEqual(annotations.texts, []) | ||
self.assertEqual(annotations.safe_searches, ()) | ||
self.assertEqual(annotations.properties, ()) | ||
self.assertEqual(len(annotations.safe_searches), 1) |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
d337f84
to
259711d
Compare
@dhermes this should be ready to go. Let me know if you have any feedback. |
""" | ||
classifications = map(_get_pb_likelihood, [image.adult, image.spoof, | ||
image.medical, | ||
image.violence]) |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
self.assertIsInstance(annotations.safe_searches, SafeSearchAnnotation) | ||
safe_search = annotations.safe_searches | ||
unknown = Likelihood.UNKNOWN | ||
self.assertEqual(safe_search.adult, unknown) |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
@@ -0,0 +1,70 @@ | |||
# Copyright 2016 Google Inc. |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
|
||
def test_safe_search_annotation(self): | ||
from google.cloud.vision.likelihood import Likelihood | ||
from unit_tests._fixtures import SAFE_SEARCH_DETECTION_RESPONSE |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
@@ -224,8 +224,7 @@ categorize the entire contents of the image under four categories. | |||
>>> client = vision.Client() | |||
>>> with open('./image.jpg', 'rb') as image_file: | |||
... image = client.image(content=image_file.read()) | |||
>>> safe_search_results = image.detect_safe_search() | |||
>>> safe_search = safe_search_results[0] | |||
>>> safe_search = image.detect_safe_search() |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
@@ -0,0 +1,70 @@ | |||
# Copyright 2016 Google Inc. |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
0aa5220
to
1086bc4
Compare
Updated copyright for safe_search.py and squashed. |
…arch-from-pb Vision: Add gRPC support for safe search.
Based from #2937There's a few things I don't like about this that I'll comment on. I'm not sure how to solve them right now. Maybe you guys have some ideas?