202c6a056ab48cbe58924de77ffdd1c938447da6,vision/cloud-client/detect/detect.py,,detect_text_uri,#Any#,217

Before Change


    Detects text in the file located in Google Cloud Storage or on the Web.
    
    vision_client = vision.Client()
    image = vision_client.image(source_uri=uri)

    texts = image.detect_text()
    print("Texts:")

    for text in texts:
        print("\n"{}"".format(text.description))

        vertices = (["({},{})".format(bound.x_coordinate, bound.y_coordinate)
                    for bound in text.bounds.vertices])

        print("bounds: {}".format(",".join(vertices)))

After Change


    Detects text in the file located in Google Cloud Storage or on the Web.
    
    client = vision.ImageAnnotatorClient()
    image = types.Image()
    image.source.image_uri = uri

    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)))
// [END def_detect_text_uri]
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 12

Instances


Project Name: GoogleCloudPlatform/python-docs-samples
Commit Name: 202c6a056ab48cbe58924de77ffdd1c938447da6
Time: 2017-07-27
Author: dizcology@hotmail.com
File Name: vision/cloud-client/detect/detect.py
Class Name:
Method Name: detect_text_uri


Project Name: GoogleCloudPlatform/python-docs-samples
Commit Name: 202c6a056ab48cbe58924de77ffdd1c938447da6
Time: 2017-07-27
Author: dizcology@hotmail.com
File Name: vision/cloud-client/detect/detect.py
Class Name:
Method Name: detect_crop_hints_uri


Project Name: GoogleCloudPlatform/python-docs-samples
Commit Name: 202c6a056ab48cbe58924de77ffdd1c938447da6
Time: 2017-07-27
Author: dizcology@hotmail.com
File Name: vision/cloud-client/detect/detect.py
Class Name:
Method Name: detect_faces_uri


Project Name: GoogleCloudPlatform/python-docs-samples
Commit Name: 202c6a056ab48cbe58924de77ffdd1c938447da6
Time: 2017-07-27
Author: dizcology@hotmail.com
File Name: vision/cloud-client/detect/detect.py
Class Name:
Method Name: detect_text_uri