Skip to content
Merged
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
5 changes: 1 addition & 4 deletions vision/cloud-client/document_text/doctext.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,17 +85,14 @@ def get_document_bounds(image_file, feature):
if (feature == FeatureType.BLOCK):
bounds.append(block.bounding_box)

if (feature == FeatureType.PAGE):
bounds.append(block.bounding_box)

# The list `bounds` contains the coordinates of the bounding boxes.
# [END vision_document_text_tutorial_detect_bounds]
return bounds


def render_doc_text(filein, fileout):
image = Image.open(filein)
bounds = get_document_bounds(filein, FeatureType.PAGE)
bounds = get_document_bounds(filein, FeatureType.BLOCK)
draw_boxes(image, bounds, 'blue')
bounds = get_document_bounds(filein, FeatureType.PARA)
draw_boxes(image, bounds, 'red')
Expand Down