how can I add languageHints to my google cloud vision python code. From https://cloud.google.com/vision/docs/languages I know that it is supported but I do not know how to implement it into the code.
from google.cloud import vision
client = vision.ImageAnnotatorClient()
with io.open(path, 'rb') as image_file:
content = image_file.read()
image = vision.types.Image(content=content)
response = client.text_detection(image=image)
texts = response.text_annotations
print('Texts:')
for text in texts:
print('\n"{}"'.format(text.description))
vertices = (['({},{})'.format(vertex.x, vertex.y)
for vertex in text.bounding_poly.vertices])
print('bounds: {}'.format(','.join(vertices)))
I think I have to do it like this:
context = imageContext.setLanguageHints("ko")
response = client.text_detection(image=image, context=context)