@@ -51,7 +51,7 @@ def pic_to_text(infile):
51
51
with io .open (infile , "rb" ) as image_file :
52
52
content = image_file .read ()
53
53
54
- image = vision .types . Image (content = content )
54
+ image = vision .Image (content = content )
55
55
56
56
# For dense text, use document_text_detection
57
57
# For less dense text, use text_detection
@@ -88,16 +88,16 @@ def create_glossary(languages, project_id, glossary_name, glossary_uri):
88
88
name = client .glossary_path (project_id , location , glossary_name )
89
89
90
90
# Set language codes
91
- language_codes_set = translate .types . Glossary .LanguageCodesSet (
91
+ language_codes_set = translate .Glossary .LanguageCodesSet (
92
92
language_codes = languages
93
93
)
94
94
95
- gcs_source = translate .types . GcsSource (input_uri = glossary_uri )
95
+ gcs_source = translate .GcsSource (input_uri = glossary_uri )
96
96
97
- input_config = translate .types . GlossaryInputConfig (gcs_source = gcs_source )
97
+ input_config = translate .GlossaryInputConfig (gcs_source = gcs_source )
98
98
99
99
# Set glossary resource information
100
- glossary = translate .types . Glossary (
100
+ glossary = translate .Glossary (
101
101
name = name , language_codes_set = language_codes_set , input_config = input_config
102
102
)
103
103
@@ -145,7 +145,7 @@ def translate_text(
145
145
146
146
glossary = client .glossary_path (project_id , location , glossary_name )
147
147
148
- glossary_config = translate .types . TranslateTextGlossaryConfig (glossary = glossary )
148
+ glossary_config = translate .TranslateTextGlossaryConfig (glossary = glossary )
149
149
150
150
parent = f"projects/{ project_id } /locations/{ location } "
151
151
0 commit comments