Skip to content

Commit 3abc7bc

Browse files
chore(deps): update dependency google-cloud-vision to v2 (#71)
* 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]>
1 parent 483039f commit 3abc7bc

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

translation/samples/snippets/hybrid_glossaries/hybrid_tutorial.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ def pic_to_text(infile):
5151
with io.open(infile, "rb") as image_file:
5252
content = image_file.read()
5353

54-
image = vision.types.Image(content=content)
54+
image = vision.Image(content=content)
5555

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

9090
# Set language codes
91-
language_codes_set = translate.types.Glossary.LanguageCodesSet(
91+
language_codes_set = translate.Glossary.LanguageCodesSet(
9292
language_codes=languages
9393
)
9494

95-
gcs_source = translate.types.GcsSource(input_uri=glossary_uri)
95+
gcs_source = translate.GcsSource(input_uri=glossary_uri)
9696

97-
input_config = translate.types.GlossaryInputConfig(gcs_source=gcs_source)
97+
input_config = translate.GlossaryInputConfig(gcs_source=gcs_source)
9898

9999
# Set glossary resource information
100-
glossary = translate.types.Glossary(
100+
glossary = translate.Glossary(
101101
name=name, language_codes_set=language_codes_set, input_config=input_config
102102
)
103103

@@ -145,7 +145,7 @@ def translate_text(
145145

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

148-
glossary_config = translate.types.TranslateTextGlossaryConfig(glossary=glossary)
148+
glossary_config = translate.TranslateTextGlossaryConfig(glossary=glossary)
149149

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
google-cloud-translate==3.0.0
2-
google-cloud-vision==1.0.0
2+
google-cloud-vision==2.0.0
33
google-cloud-texttospeech==2.1.0

0 commit comments

Comments
 (0)