Title: Image.detect_faces raises KeyError when the image doesn't contain any faces · Issue #2749 · googleapis/google-cloud-python · GitHub
Open Graph Title: Image.detect_faces raises KeyError when the image doesn't contain any faces · Issue #2749 · googleapis/google-cloud-python
X Title: Image.detect_faces raises KeyError when the image doesn't contain any faces · Issue #2749 · googleapis/google-cloud-python
Description: Expected behavior: An empty list is returned from detect_faces. Ubuntu 16.04 Python 3.5.2 google-cloud version: 0.21.0 Code example import google.cloud.vision.client import base64 test_image_base64 = '''iVBORw0KGgoAAAANSUhEUgAAAOEAAADhCA...
Open Graph Description: Expected behavior: An empty list is returned from detect_faces. Ubuntu 16.04 Python 3.5.2 google-cloud version: 0.21.0 Code example import google.cloud.vision.client import base64 test_image_base64...
X Description: Expected behavior: An empty list is returned from detect_faces. Ubuntu 16.04 Python 3.5.2 google-cloud version: 0.21.0 Code example import google.cloud.vision.client import base64 test_image_base64...
Opengraph URL: https://github.com/googleapis/google-cloud-python/issues/2749
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Image.detect_faces raises KeyError when the image doesn't contain any faces","articleBody":"\r\n\r\nExpected behavior: An empty list is returned from detect_faces.\r\n\r\nUbuntu 16.04\r\nPython 3.5.2\r\ngoogle-cloud version: 0.21.0\r\n\r\n## Code example\r\n~~~python\r\nimport google.cloud.vision.client\r\nimport base64\r\n\r\ntest_image_base64 = '''iVBORw0KGgoAAAANSUhEUgAAAOEAAADhCAMAAAAJbSJIAAAAZlBMVEU7lNn1+Pr6+/v7/Ps0kdg2\r\nktguj9jy9/pxruHS5PPi7vfo8fj4+fsijNdBl9rs8/jB2O/F3PDY6PWx0Oxgp9/O4vNWod15s+On\r\nzOtoquC41e6Mveafx+mIueXD2e9/t+Sawudaot4YIx/WAAAFu0lEQVR4nO2d23biOgxAE8dyIDHJ\r\nALkAgYH+/0+euECBTqFcbEnhaL+0j+wlWb7GjiJBEARBEARBEARBEARBEARBEARBEARBEP4BtDET\r\nhzFaU/8Y/4AxH928zsq4z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v59+xi+vyFFlr5/LX3/\r\n/tDTR793GhKM2t5/5K23qIYEsyecszRfhgRnaqBBNSTYuIAIs9IkFMe9MddL45xk76lGXBGuSfae\r\nEAc1NCcwMbt8ig7//7BDCgWiIc2RoQlaMbU50VkMtFJDddRbd2iGBONuByzRzrVRnfSGJ2+AfBSb\r\nkZ2gRZrm030r+/6noKFBSVNLeOcnzooixUriEZydbood7iNQIKSpzSi/IsXYJqX8KAjnUA3xzRGT\r\nOvhXsjXxV7LhJ4nU1/CEuUDphJ1RXxuhN4FvHCD+WN3rnZ4/weBejMCDU9oPufdAFLCcqpo+hH0Q\r\nlwENl/QhjEKOvynH3OdA9NRzFr9jqe81+cJ0gQw7HiGMQn16QfORxc9AE2Bx2HK45+sL0wa4v7Rl\r\nk6MO/yeGuV09D8Zzv69qbo+VeF7QsFnBp8wcePKRpyuCJcd3kXSVens5IOUo+Hlfsh9FS3/R3hVM\r\n6yWKNuXVT5zjRZGzYK+4vPNhzuuocslY0L0LmL3W9fN/BhGKl0bhquYyYboO6MXTJdXGC3YPd/wA\r\nmFH5XKYm5YjbUO0KGlZ3P5R7FkC1AuZN8ASYdvago1WzdiAB3KOLXf5Iqqp8x2+ofRswxfzXV8e/\r\n/NJ5MagA7ukdF+XNp+MP+ZmUiyH6OcDApo5vStokrjcwUD9HXxyr9axMfiw7ViXlbF31pZf6Z74G\r\nGF11qzyNlVJ2L2pt/3+c5quu0gMO3xmgjWna3Xw6zsrUpmU2ns53bWPM0KN3gbM0kyPmzewEQRAE\r\nQRAEQRAEQRAEQRAEQRAEQRAEwQ//AapBX5sm4PxNAAAAAElFTkSuQmCC'''\r\n\r\ntest_image_bytes = base64.b64decode(test_image_base64)\r\n\r\nclient = google.cloud.vision.Client()\r\n\r\nimage = client.image(\r\n content=test_image_bytes,\r\n)\r\n\r\nfaces = image.detect_faces()\r\nprint(faces)\r\n\r\n~~~\r\n\r\n\r\n## Stack trace\r\nTraceback (most recent call last):\r\n File \"test.py\", line 42, in \u003cmodule\u003e\r\n faces = image.detect_faces()\r\n File \"/home/tal/virtualenv/lib/python3.5/site-packages/google/cloud/vision/image.py\", line 138, in detect_faces\r\n return self._detect_annotation(features)\r\n File \"/home/tal/virtualenv/lib/python3.5/site-packages/google/cloud/vision/image.py\", line 125, in _detect_annotation\r\n _entity_from_response_type(feature.feature_type, results))\r\n File \"/home/tal/virtualenv/lib/python3.5/site-packages/google/cloud/vision/image.py\", line 226, in _entity_from_response_type\r\n Face.from_api_repr(face) for face in results[feature_key])\r\nKeyError: 'faceAnnotations'\r\n","author":{"url":"https://github.com/talzion12","@type":"Person","name":"talzion12"},"datePublished":"2016-11-17T15:24:09.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":1},"url":"https://github.com/2749/google-cloud-python/issues/2749"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:c0ddfbf1-50b5-64e7-2b68-2243d5beb2e1 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | D5D6:1A72E:9783AD:CCC004:6A4D3FF9 |
| html-safe-nonce | 625d9cb7d6466c6bb1a8441747aaa5c58b447d18e9154abcaadbfe734c8f4eec |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJENUQ2OjFBNzJFOjk3ODNBRDpDQ0MwMDQ6NkE0RDNGRjkiLCJ2aXNpdG9yX2lkIjoiNTczMzY1MDY5NzYyODIzNzgxNyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | a574e1cbf770ae17f27a77bf1359d46d6de225f2aca66e9b95aab67f86ac74e4 |
| hovercard-subject-tag | issue:190077236 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/googleapis/google-cloud-python/2749/issue_layout |
| twitter:image | https://opengraph.githubassets.com/3d0bfc8852e30fff5819b2701b06e154569f61feb0a8d92b756df49619ff4436/googleapis/google-cloud-python/issues/2749 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/3d0bfc8852e30fff5819b2701b06e154569f61feb0a8d92b756df49619ff4436/googleapis/google-cloud-python/issues/2749 |
| og:image:alt | Expected behavior: An empty list is returned from detect_faces. Ubuntu 16.04 Python 3.5.2 google-cloud version: 0.21.0 Code example import google.cloud.vision.client import base64 test_image_base64... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | talzion12 |
| hostname | github.com |
| expected-hostname | github.com |
| None | 92571a8944142227b7e19cd10918b1ddd06e5066c1ad5bc7e4769cf6140a87e6 |
| turbo-cache-control | no-preview |
| go-import | github.com/googleapis/google-cloud-python git https://github.com/googleapis/google-cloud-python.git |
| octolytics-dimension-user_id | 16785467 |
| octolytics-dimension-user_login | googleapis |
| octolytics-dimension-repository_id | 16316451 |
| octolytics-dimension-repository_nwo | googleapis/google-cloud-python |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 16316451 |
| octolytics-dimension-repository_network_root_nwo | googleapis/google-cloud-python |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 56fc8347865a14e2ec811533d68f929cf4e0ec19 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width