aws-samples / aws-samples/amazon-textract-textractor

For textractor.entities.line.Line - visualize() breaks

Open
#312 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Jupyter Notebook
Stars
493
Forks
163
PR merge metrics
No merged PRs in 30d

Description

When trying to visualize "Line" objects I am getting:
```
106 return EntityList(list(set(new_entity_list))).visualize(
107 with_text=with_text,
108 with_words=with_words,
109 with_confidence=with_confidence,
110 font_size_ratio=font_size_ratio,
111 )
112 elif len(self) > 0 and self[0].bbox.spatial_object.image is None:
--> 113 raise NoImageException(
114 "Image was not saved during the Textract API call. Set save_image=True when calling the Textractor methods to use the visualize() method."
115 )
117 visualized_images = {}
118 entities_pagewise = defaultdict(list)

NoImageException: Image was not saved during the Textract API call. Set save_image=True when calling the Textractor methods to use the visualize() method.
```

I can confirm that save_image=True via:
```
document = extractor.analyze_document(
save_image=True,
file_source=image,
features=FEATURES)
```

and I can properly visualize Document, KeyValues, Tables etc on the same extraction.

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the failure through textractor.entities.line.Line.visualize() after analyze_document(save_image=True, file_source=image, features=FEATURES). Compare Line visualization with the working Document, KeyValues, and Tables cases, then verify that the same extraction no longer raises NoImageException for Line objects.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, python
Domain
computer-vision
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.