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

gcv_agent.py bugs: 'google.cloud.vision' has no attribute 'types' #171

Open
Andrew-Kao opened this issue Feb 23, 2023 · 1 comment
Open
Labels
bug Something isn't working

Comments

@Andrew-Kao
Copy link

Describe the bug

On initializing the gcv_agent, the following error occurs:
AttributeError: module 'google.cloud.vision' has no attribute 'types'
This error is thrown at line 119 of layoutparser/ocr/gcv_agent.py:
self._context = _vision.types.ImageContext(language_hints=languages)
Editing line 119 to this fixes it:
self._context = _vision.ImageContext(language_hints=languages)

The same goes for line 134:
img_content = _vision.types.Image(content=img_content)
which runs correctly when modified to:
img_content = _vision.Image(content=img_content)

To Reproduce

  1. This occurs if you follow the tutorial: https://layout-parser.readthedocs.io/en/latest/example/parse_ocr/index.html#initiate-gcv-ocr-engine-and-check-the-image at the step where the ocr_agent is initialized

Environment
Platform is MacOS with LayoutParser 0.3.4

@Andrew-Kao Andrew-Kao added the bug Something isn't working label Feb 23, 2023
@wr0124
Copy link

wr0124 commented Jun 6, 2023

same here

'GCVAgent' object has no attribute '_client'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants