Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Google Vision OCR block to workflows #709

Merged
merged 3 commits into from
Oct 2, 2024

Conversation

brunopicinin
Copy link
Contributor

Description

Adds a new workflow OCR block, based on Google Vision API. The block outputs the text for the whole image as well as detected language and sv.Detections(...) for text blocks with proper labels.

Type of change

Please delete options that are not relevant.

  • New feature (non-breaking change which adds functionality)

How has this change been tested, please provide a testcase or example of how you tested the change?

  1. Tested locally with an image of pure text, using ocr_text_detection mode:

CleanShot 2024-10-01 at 21 17 40@2x

CleanShot 2024-10-01 at 21 17 48@2x

  1. Tested locally with a picture containing some text, using text_detection mode:

CleanShot 2024-10-01 at 21 25 39@2x

CleanShot 2024-10-01 at 21 25 47@2x

  1. Tested locally with an image without text:

CleanShot 2024-10-01 at 21 26 43@2x

@CLAassistant
Copy link

CLAassistant commented Oct 2, 2024

CLA assistant check
All committers have signed the CLA.

@brunopicinin
Copy link
Contributor Author

I ended up using the fullTextAnnotation for the blocks. Doing some tests, it seems to give "more natural" results than the textAnnotations for the text blocks. Also, it comes with confidence score on DOCUMENT_TEXT_DETECTION mode.

As an exemple, the difference in the Google Vision API output for the following image:

sign

CleanShot 2024-10-01 at 21 38 39@2x

Copy link
Collaborator

@PawelPeczek-Roboflow PawelPeczek-Roboflow left a comment

Choose a reason for hiding this comment

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

Great contribution 💪
I am very positively surprised on the speed and quality. The comments are minor - I am willing to accept the contribution and apply myself or you can do it if you wanted.

Do you have any comments / suggestions / feature requests regarding Workflows ecosystem as a result of this contribution?

@PawelPeczek-Roboflow PawelPeczek-Roboflow merged commit bba3742 into roboflow:main Oct 2, 2024
25 of 54 checks passed
@brunopicinin brunopicinin deleted the google-vision-ocr branch October 2, 2024 20:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants