GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Fix vision error when no results returned. by daspecster · Pull Request #2750 · googleapis/google-cloud-python

Conversation

@daspecster

@daspecster daspecster commented Nov 17, 2016

Copy link
Copy Markdown
Contributor

Fixes #2749.

  • Added tests for no results coming from service.
  • Fixed bug introduced by Refactor _detect_annotation() to support all annotation types. #2712.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@daspecster
Fix vision error when no results returned.
7aa42be
@daspecster daspecster added the api: vision Issues related to the Cloud Vision API. label Nov 17, 2016
@daspecster daspecster assigned tseaver and dhermes Nov 17, 2016
@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Nov 17, 2016
@daspecster daspecster mentioned this pull request Nov 17, 2016
Image.detect_faces raises KeyError when the image doesn't contain any faces #2749
Closed
dhermes
dhermes reviewed Nov 17, 2016
View reviewed changes
Comment thread vision/google/cloud/vision/image.py Outdated

detected_objects = []
feature_key = _REVERSE_TYPES[feature_type]
annotations = results.get(feature_key, [])

This comment was marked as spam.

Sign in to view

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

daspecster added 2 commits November 17, 2016 13:48
@daspecster
Return early for empty response.
2896662
@daspecster
Move detected_objects below early return.
51539e1
dhermes
dhermes approved these changes Nov 17, 2016
View reviewed changes

@dhermes dhermes left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread vision/unit_tests/test_client.py
self.assertEqual(5, image_request['features'][0]['maxResults'])

def test_face_detection_from_content_no_results(self):
RETURNED = {

This comment was marked as spam.

Sign in to view

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Comment thread vision/unit_tests/test_client.py
faces = image.detect_faces(limit=5)
self.assertEqual(faces, [])
self.assertEqual(len(faces), 0)
image_request = client._connection._requested[0]['data']['requests'][0]

This comment was marked as spam.

Sign in to view

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

This comment was marked as spam.

Sign in to view

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

This comment was marked as spam.

Sign in to view

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@daspecster

daspecster commented Nov 17, 2016

Copy link
Copy Markdown
Contributor Author

@dhermes, I'll merge this and follow up with some test improvements.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@daspecster
daspecster merged commit a10cf56 into googleapis:master Nov 17, 2016
@daspecster
daspecster deleted the fix-vision-face-no-results branch November 17, 2016 21:34
@dhermes dhermes mentioned this pull request Dec 9, 2016
Update versions for mega-release. #2846
Merged
richkadel pushed a commit to richkadel/google-cloud-python that referenced this pull request May 6, 2017
@daspecster
Merge pull request googleapis#2750 from daspecster/fix-vision-face-no…
af888fe
…-results

Fix vision error when no results returned.
@theacodes theacodes unassigned dhermes Sep 28, 2018
parthea pushed a commit that referenced this pull request Oct 21, 2023
@daspecster
Merge pull request #2750 from daspecster/fix-vision-face-no-results
890b77c
Fix vision error when no results returned.
parthea pushed a commit that referenced this pull request Oct 21, 2023
@nnegrey @leahecole @busunkim96
automl: video beta - move beta samples out of branch and into master [(…
376ab1f
…#2750)](GoogleCloudPlatform/python-docs-samples#2750)

* automl: video beta - move beta samples out of branch and into master

* lint

* update error message on batch predict

Co-authored-by: Leah E. Cole <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

1 more reviewer
@dhermes dhermes dhermes approved these changes
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

@tseaver tseaver

Labels

api: vision Issues related to the Cloud Vision API. cla: yes This human has signed the Contributor License Agreement.

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

4 participants

@daspecster @dhermes @tseaver @googlebot
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.