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 — Vision API features update by beccasaurus · Pull Request #1353 · GoogleCloudPlatform/python-docs-samples

Conversation

@beccasaurus

@beccasaurus beccasaurus commented Feb 7, 2018

Copy link
Copy Markdown
Contributor

This is a REDO of the previous PR: Vision API features update #1339

(That PR deleted some Beta samples which are still required by the docs)

Reverted & brought back the Beta samples!

Let's try this again 😄

Sorry, something went wrong.

Uh oh!

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

All reactions
Rebecca Taylor added 2 commits February 7, 2018 12:44
Rebecca Taylor
Revert "Revert "Vision API features update (#1339)" (#1351)"
e09c62f
This reverts commit 7b39e19.
Rebecca Taylor
Bring back the Vision Beta samples
b93e6b4
@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Feb 7, 2018
@beccasaurus
beccasaurus requested a review from dizcology February 7, 2018 21:03
@beccasaurus

beccasaurus commented Feb 8, 2018 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown
Contributor Author

I noticed that detect.py does not use the canonical region tags for its snippets (there are lots of unconventional def_.... region tags)

Is this a good time to change those? I was trying to copy detect.py, treating it as if it's the canonical, but it's really NOT CANONICAL for Vision snippets

/cc @sirtorry

All reactions

Sorry, something went wrong.

Uh oh!

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

@theacodes

theacodes commented Feb 8, 2018

Copy link
Copy Markdown
Contributor

@remi totally up to you. Python uses indented_block because it keeps things simple and generally we can name the functions the same as the region tags (go also has similar go_func functionality). But it doesn't matter either way style-wise, it's just preference.

All reactions

Sorry, something went wrong.

Uh oh!

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

@beccasaurus

beccasaurus commented Feb 8, 2018 via email

Copy link
Copy Markdown
Contributor Author
For ML API samples (only) is it okay if we discontinue indented_ block and use explicit (globally unique, eg. vision_x) region tags (they will ideally always be the same as the function name). I'm starting to use a tool to organize ML API code samples and the tool loves region tags :)
On Thu, Feb 8, 2018 at 3:51 PM Jon Wayne Parrott ***@***.***> wrote: @remi <https://github.com/remi> totally up to you. Python uses indented_block because it keeps things simple and generally we can name the functions the same as the region tags (go also has similar go_func functionality). But it doesn't matter either way style-wise, it's just preference. — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub <#1353 (comment)>, or mute the thread <https://github.com/notifications/unsubscribe-auth/AAABGAjFOL9RaMS-ADJx4ACYdW7VrWzYks5tS4hqgaJpZM4R9Yz_> .
-- Rebecca Taylor | Developer Programs Engineer | [email protected]
All reactions

Sorry, something went wrong.

Uh oh!

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

@theacodes

theacodes commented Feb 8, 2018

Copy link
Copy Markdown
Contributor

Yep - hence my last comment- totally up to you. Within this repo there are samples that use both styles in the same file, even.

All reactions

Sorry, something went wrong.

Uh oh!

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

@beccasaurus

beccasaurus commented Feb 8, 2018 via email

Copy link
Copy Markdown
Contributor Author
Perfect, thanks! 🙏
On Thu, Feb 8, 2018 at 3:56 PM Jon Wayne Parrott ***@***.***> wrote: Yep - hence my last comment- totally up to you. Within this repo there are samples that use both styles in the same file, even. — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub <#1353 (comment)>, or mute the thread <https://github.com/notifications/unsubscribe-auth/AAABGPSd8K25_5ohLcDYbAaod-wUYJjPks5tS4m7gaJpZM4R9Yz_> .
-- Rebecca Taylor | Developer Programs Engineer | [email protected]
All reactions

Sorry, something went wrong.

Uh oh!

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

beccasaurus
beccasaurus commented Feb 13, 2018
View reviewed changes
Comment thread vision/cloud-client/detect/detect.py
print(u'Paragraph Confidence: {}\n'.format(
paragraph.confidence))

block_text = ''

@beccasaurus beccasaurus Feb 13, 2018 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown
Contributor Author

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.

@dizcology I really, really struggle to easily understand what this sample is doing

It's not easy on the eyes & doesn't read like prose on the website IMO

Do you like this sample? Any ideas for ways to highlight parts TextAnnotation that developers want to know about in a more consumable, easy to read sample?

Sorry, something went wrong.

Uh oh!

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

All reactions

@beccasaurus beccasaurus Feb 13, 2018 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown
Contributor Author

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.

For Ruby, I'm rolling with this:

  # image_path = "Google Cloud Storage URI, eg. 'gs://my-bucket/image.png'"

  require "google/cloud/vision"

  vision = Google::Cloud::Vision.new

  document = vision.document_text_detection(image_path).full_text_annotation

  puts "Full document text: #{document.text}"

  document.pages.each do |page|
    page.blocks.each  do |block|
      block.paragraphs.each do |paragraph|
        puts "Paragraph confidence: #{paragraph.confidence}"
        paragraph.words.each do |word|
          puts "\tWord confidence: #{word.confidence}"
          puts "\tWord text: #{word.symbols.map(&:text).join}"
          word.symbols.each do |symbol|
            puts "\t\tSymbol text: #{symbol.text}"
            puts "\t\tSymbol confidence: #{symbol.confidence}"
          end
        end
      end
    end
  end

I almost don't want to include anything that concatenates/joins text together to print it out (developers can figure that out?) ... but, at least in Ruby it's idiomatic and relatively readable to print out each word:

puts "\tWord text: #{word.symbols.map(&:text).join}"

The Python snippet includes:

  • 2 Lists used to build up data to print
  • 2 Strings used to build data to print
  • Logic to extend Lists
  • Also, 2 types of syntax are used to concatenate strings:
word_text = word_text + symbol.text
block_text += ' ' + word_text

^--- both should use += or not use += (should be consistent)

Thoughts?

Sorry, something went wrong.

Uh oh!

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

All reactions

@beccasaurus beccasaurus Feb 13, 2018 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown
Contributor Author

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.

Also: I vote that the sample shows how to print out the WHOLE text without having to concatenate symbols⇒words⇒paragraphs⇒blocks⇒pages, because this is a very common use-case

^---- also, what is a block? ... I hope the docs make that clear, because it's not obvious to me ...

Sorry, something went wrong.

Uh oh!

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

All reactions

@beccasaurus beccasaurus Feb 28, 2018

Copy link
Copy Markdown
Contributor Author

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.

ping @dizcology for thoughts

Also, would love to get this ready for merge ~ this comment is my only remaining question IIRC 😄

Sorry, something went wrong.

Uh oh!

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

All reactions
@beccasaurus

beccasaurus commented Apr 3, 2018

Copy link
Copy Markdown
Contributor Author

Hey, @dizcology we can close this, right? Vision GA was merged #1427

All reactions

Sorry, something went wrong.

Uh oh!

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

@beccasaurus

beccasaurus commented Aug 3, 2018

Copy link
Copy Markdown
Contributor Author

Closing PR /cc @dizcology

All reactions

Sorry, something went wrong.

Uh oh!

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

@beccasaurus beccasaurus closed this Aug 3, 2018
@beccasaurus
beccasaurus deleted the vision-api-features-update branch August 8, 2018 21:17
@chalmerlowe chalmerlowe mentioned this pull request Apr 7, 2026
migrate code from googleapis/python-storage #13989
Merged
9 tasks
chalmerlowe pushed a commit that referenced this pull request Apr 7, 2026
@cojenco
tests: unflake ud system test to only run in prod and hmac sample test (
31e6e88
#1353)

* test: test universe domain client only in prod

* unflake hmac snippet test
@parthea parthea mentioned this pull request Sep 8, 2026
migrate code from googleapis/python-bigquery #14589
Closed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@dizcology dizcology Awaiting requested review from dizcology

Uh oh!

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

Assignees

No one assigned

Labels

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.

3 participants

@beccasaurus @theacodes @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.