Skip to content

Commit

Permalink
chore(deps): update dependency google-cloud-vision to v2 (#71)
Browse files Browse the repository at this point in the history
* chore(deps): update dependency google-cloud-vision to v2

* remove types

Co-authored-by: Leah Cole <[email protected]>
Co-authored-by: Leah E. Cole <[email protected]>
  • Loading branch information
3 people authored Oct 13, 2020
1 parent 483039f commit 3abc7bc
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def pic_to_text(infile):
with io.open(infile, "rb") as image_file:
content = image_file.read()

image = vision.types.Image(content=content)
image = vision.Image(content=content)

# For dense text, use document_text_detection
# For less dense text, use text_detection
Expand Down Expand Up @@ -88,16 +88,16 @@ def create_glossary(languages, project_id, glossary_name, glossary_uri):
name = client.glossary_path(project_id, location, glossary_name)

# Set language codes
language_codes_set = translate.types.Glossary.LanguageCodesSet(
language_codes_set = translate.Glossary.LanguageCodesSet(
language_codes=languages
)

gcs_source = translate.types.GcsSource(input_uri=glossary_uri)
gcs_source = translate.GcsSource(input_uri=glossary_uri)

input_config = translate.types.GlossaryInputConfig(gcs_source=gcs_source)
input_config = translate.GlossaryInputConfig(gcs_source=gcs_source)

# Set glossary resource information
glossary = translate.types.Glossary(
glossary = translate.Glossary(
name=name, language_codes_set=language_codes_set, input_config=input_config
)

Expand Down Expand Up @@ -145,7 +145,7 @@ def translate_text(

glossary = client.glossary_path(project_id, location, glossary_name)

glossary_config = translate.types.TranslateTextGlossaryConfig(glossary=glossary)
glossary_config = translate.TranslateTextGlossaryConfig(glossary=glossary)

parent = f"projects/{project_id}/locations/{location}"

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
google-cloud-translate==3.0.0
google-cloud-vision==1.0.0
google-cloud-vision==2.0.0
google-cloud-texttospeech==2.1.0

0 comments on commit 3abc7bc

Please sign in to comment.