Skip to content

Commit 635150e

Browse files
authored
Vision - remove unused region tags (#1620)
1 parent 5ae5675 commit 635150e

File tree

3 files changed

+2
-8
lines changed

3 files changed

+2
-8
lines changed

vision/api/label/label.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ def main(photo_file):
4141
service = googleapiclient.discovery.build('vision', 'v1')
4242
# [END authenticate]
4343

44-
# [START construct_request]
4544
with open(photo_file, 'rb') as image:
4645
image_content = base64.b64encode(image.read())
4746
service_request = service.images().annotate(body={
@@ -55,7 +54,6 @@ def main(photo_file):
5554
}]
5655
}]
5756
})
58-
# [END construct_request]
5957
# [START parse_response]
6058
response = service_request.execute()
6159
label = response['responses'][0]['labelAnnotations'][0]['description']

vision/cloud-client/detect/detect.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -479,7 +479,7 @@ def detect_web_uri(uri):
479479
# [START vision_web_entities_include_geo_results]
480480
def web_entities_include_geo_results(path):
481481
"""Detects web annotations given an image, using the geotag metadata
482-
in the iamge to detect web entities."""
482+
in the image to detect web entities."""
483483
client = vision.ImageAnnotatorClient()
484484

485485
with io.open(path, 'rb') as image_file:
@@ -503,7 +503,7 @@ def web_entities_include_geo_results(path):
503503
# [START vision_web_entities_include_geo_results_uri]
504504
def web_entities_include_geo_results_uri(uri):
505505
"""Detects web annotations given an image in the file located in
506-
Google Cloud Storage., using the geotag metadata in the iamge to
506+
Google Cloud Storage., using the geotag metadata in the image to
507507
detect web entities."""
508508
client = vision.ImageAnnotatorClient()
509509

vision/cloud-client/document_text/doctext.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ class FeatureType(Enum):
4141

4242
def draw_boxes(image, bounds, color):
4343
"""Draw a border around the image using the hints in the vector list."""
44-
# [START draw_blocks]
4544
draw = ImageDraw.Draw(image)
4645

4746
for bound in bounds:
@@ -51,7 +50,6 @@ def draw_boxes(image, bounds, color):
5150
bound.vertices[2].x, bound.vertices[2].y,
5251
bound.vertices[3].x, bound.vertices[3].y], None, color)
5352
return image
54-
# [END draw_blocks]
5553

5654

5755
def get_document_bounds(image_file, feature):
@@ -96,7 +94,6 @@ def get_document_bounds(image_file, feature):
9694

9795

9896
def render_doc_text(filein, fileout):
99-
# [START render_doc_text]
10097
image = Image.open(filein)
10198
bounds = get_document_bounds(filein, FeatureType.PAGE)
10299
draw_boxes(image, bounds, 'blue')
@@ -109,7 +106,6 @@ def render_doc_text(filein, fileout):
109106
image.save(fileout)
110107
else:
111108
image.show()
112-
# [END render_doc_text]
113109

114110

115111
if __name__ == '__main__':

0 commit comments

Comments
 (0)