Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vision - remove unused region tags #1620

Merged
merged 1 commit into from
Aug 10, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions vision/api/label/label.py
Original file line number Diff line number Diff line change
Expand Up @@ -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={
Expand All @@ -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']
Expand Down
4 changes: 2 additions & 2 deletions vision/cloud-client/detect/detect.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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()

Expand Down
4 changes: 0 additions & 4 deletions vision/cloud-client/document_text/doctext.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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):
Expand Down Expand Up @@ -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')
Expand All @@ -109,7 +106,6 @@ def render_doc_text(filein, fileout):
image.save(fileout)
else:
image.show()
# [END render_doc_text]


if __name__ == '__main__':
Expand Down