Uh oh!
There was an error while loading. Please reload this page.
Vision: Add gRPC support for safe search. - #2938
Conversation
| 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.
Uh oh!
There was an error while loading. Please reload this page.
d337f84 to
259711dComparedaspecster
commented
Jan 23, 2017
@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.
Uh oh!
There was an error while loading. Please reload this page.
| 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.
Uh oh!
There was an error while loading. Please reload this page.
| @@ -0,0 +1,70 @@ | |||
| # Copyright 2016 Google Inc. | |||
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
| 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.
Uh oh!
There was an error while loading. Please reload this page.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
| ... 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.
Uh oh!
There was an error while loading. Please reload this page.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
| @@ -0,0 +1,70 @@ | |||
| # Copyright 2016 Google Inc. | |||
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
0aa5220 to
1086bc4CompareUpdated 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?