diff --git a/vision/api/label/label.py b/vision/api/label/label.py index a75b0af3711..78475705b8f 100755 --- a/vision/api/label/label.py +++ b/vision/api/label/label.py @@ -41,7 +41,6 @@ def main(photo_file): service = googleapiclient.discovery.build('vision', 'v1') # [END authenticate] - # [START construct_request] with open(photo_file, 'rb') as image: image_content = base64.b64encode(image.read()) service_request = service.images().annotate(body={ @@ -55,7 +54,6 @@ def main(photo_file): }] }] }) - # [END construct_request] # [START parse_response] response = service_request.execute() label = response['responses'][0]['labelAnnotations'][0]['description'] diff --git a/vision/cloud-client/detect/detect.py b/vision/cloud-client/detect/detect.py index 7a15430d625..695e52f3a54 100644 --- a/vision/cloud-client/detect/detect.py +++ b/vision/cloud-client/detect/detect.py @@ -479,7 +479,7 @@ def detect_web_uri(uri): # [START vision_web_entities_include_geo_results] def web_entities_include_geo_results(path): """Detects web annotations given an image, using the geotag metadata - in the iamge to detect web entities.""" + in the image to detect web entities.""" client = vision.ImageAnnotatorClient() with io.open(path, 'rb') as image_file: @@ -503,7 +503,7 @@ def web_entities_include_geo_results(path): # [START vision_web_entities_include_geo_results_uri] def web_entities_include_geo_results_uri(uri): """Detects web annotations given an image in the file located in - Google Cloud Storage., using the geotag metadata in the iamge to + Google Cloud Storage., using the geotag metadata in the image to detect web entities.""" client = vision.ImageAnnotatorClient() diff --git a/vision/cloud-client/document_text/doctext.py b/vision/cloud-client/document_text/doctext.py index 478f2e22731..3dee17b041f 100644 --- a/vision/cloud-client/document_text/doctext.py +++ b/vision/cloud-client/document_text/doctext.py @@ -41,7 +41,6 @@ class FeatureType(Enum): def draw_boxes(image, bounds, color): """Draw a border around the image using the hints in the vector list.""" - # [START draw_blocks] draw = ImageDraw.Draw(image) for bound in bounds: @@ -51,7 +50,6 @@ def draw_boxes(image, bounds, color): bound.vertices[2].x, bound.vertices[2].y, bound.vertices[3].x, bound.vertices[3].y], None, color) return image - # [END draw_blocks] def get_document_bounds(image_file, feature): @@ -96,7 +94,6 @@ def get_document_bounds(image_file, feature): def render_doc_text(filein, fileout): - # [START render_doc_text] image = Image.open(filein) bounds = get_document_bounds(filein, FeatureType.PAGE) draw_boxes(image, bounds, 'blue') @@ -109,7 +106,6 @@ def render_doc_text(filein, fileout): image.save(fileout) else: image.show() - # [END render_doc_text] if __name__ == '__main__':