[Python] Google Vision AI does not include correct documentation

Discussão em 'Python' iniciado por Stack, Fevereiro 21, 2025.

  1. Stack

    Stack Membro Participativo

    I am using the following code to do OCR using Google Vision AI:

    from google.cloud import vision
    client = vision.ImageAnnotatorClient()
    bindata = base64.b64decode(b64data) # b64data is a Base64 encoded image file
    image = vision.Image(content=bindata)
    results = client.text_detection(image=image)


    Which works fine for most images. I found now an image where text is not detected, but when I rotate the image, it does get detected.

    So, I am looking for extra options I could possibly give the text_detection method, but I can nowhere find good reference documentation on it. Even the official Google documentation does not include that method.

    Where can I find the right documentation for the text_detection method? (Or, better, how can I improve the OCR detection to correctly detect upside down text).

    Continue reading...

Compartilhe esta Página