Uh oh!
There was an error while loading. Please reload this page.
Vision: Add gRPC support for face detection. - #2922
Conversation
| if coordinate is None: | ||
| return | ||
| self.assertIsInstance(coordinate, (int, float)) | ||
| self.assertNotEqual(coordinate, 0.0) |
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.
| class TestVisionClientFace(BaseVisionTestCase): | ||
| def setUp(self): | ||
| Config.CLIENT = vision.Client(use_gax=True) |
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_detect_text_content(self): | ||
| client = Config.CLIENT | ||
| client._use_gax = True |
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.
| :rtype: :class:`~google.cloud.vision.likelihood.Likelihood` | ||
| :returns: Instance of ``Likelihood`` converted from gRPC value. | ||
| """ | ||
| likelihood_pb = LIKELIHOOD_PB.get(likelihood) |
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.
| return cls(roll, pan, tilt) | ||
| @classmethod | ||
| def from_pb(cls, 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.
| def from_pb(cls, response_landmark): | ||
| """Factory: construct an instance of a Landmark from a response. | ||
| :type response_landmark: dict |
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.
| """ | ||
| landmarks = [] | ||
| for landmark in response: | ||
| landmarks.append(Landmark.from_api_repr(landmark)) |
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.
| if content is not None: | ||
| content = _bytes_to_unicode(b64encode(_to_bytes(content))) | ||
| content = _to_bytes(content) |
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.
| if self.content: | ||
| return { | ||
| 'content': self.content | ||
| 'content': _bytes_to_unicode(b64encode(self.content)) |
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.
| self.assertEqual(entity.locations[0].longitude, 2.0) | ||
| class TestMakeFacesFromPB(unittest.TestCase): |
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.
b5bf40f to
28bc79eComparegooglebot
commented
Jan 13, 2017
So there's good news and bad news. 👍 The good news is that everyone that needs to sign a CLA (the pull request submitter and all commit authors) have done so. Everything is all good there. 😕 The bad news is that it appears that one or more commits were authored by someone other than the pull request submitter. We need to confirm that they're okay with their commits being contributed to this project. Please have them confirm that here in the pull request. Note to project maintainer: This is a terminal state, meaning the |
28bc79e to
c30955dComparegooglebot
commented
Jan 13, 2017
CLAs look good, thanks! |
732c099 to
46edcc2Comparedaspecster
commented
Jan 14, 2017
Rebased on master. |
b17c58a to
01474ccCompare| class TestVisionClientFace(BaseVisionTestCase): | ||
| def setUp(self): | ||
| Config.CLIENT = vision.Client() |
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.
| """ | ||
| if image.content is not None: | ||
| return image_annotator_pb2.Image(content=_to_bytes(image.content)) | ||
| return image_annotator_pb2.Image(content=image.content) |
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 __init__(self, project=None, credentials=None, http=None, | ||
| use_gax=False): | ||
| use_gax=None): |
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.
| joy_likelihood = Likelihood[emotions['joyLikelihood']] | ||
| sorrow_likelihood = Likelihood[emotions['sorrowLikelihood']] | ||
| surprise_likelihood = Likelihood[emotions['surpriseLikelihood']] | ||
| anger_likelihood = Likelihood[emotions['angerLikelihood']] |
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.
| CHIN_LEFT_GONION = 'CHIN_LEFT_GONION' | ||
| CHIN_RIGHT_GONION = 'CHIN_RIGHT_GONION' | ||
| # Unknown face landmark detected. Should not be filled. | ||
| UNKNOWN_LANDMARK = 0 |
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.
| """ | ||
| return self._x_coordinate | ||
| if self._x_coordinate != 0: | ||
| return self._x_coordinate |
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.
| if content is not None: | ||
| content = _bytes_to_unicode(b64encode(_to_bytes(content))) | ||
| content = _to_bytes(content) |
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.
| if self.content: | ||
| return { | ||
| 'content': self.content | ||
| 'content': _bytes_to_unicode(b64encode(self.content)) |
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.assertEqual(annotations.labels, []) | ||
| self.assertEqual(annotations.logos, []) | ||
| self.assertEqual(annotations.faces, ()) | ||
| self.assertEqual(annotations.faces, []) |
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.
| from google.cloud.vision.annotations import _make_faces_from_pb | ||
| return _make_faces_from_pb(annotations) | ||
| def test_make_face_from_pb(self): |
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.
ff3f62b to
04517cdCompareMerging after chat LGTM and Travis went green. |
…om-pb Vision: Add gRPC support for face detection.
Based from #2918This adds gRPC support for
face_detect().