Closed goodevilgenius closed 5 years ago
Occasionally, Cloud Vision will return a textAnnotation that has no description. This can happen when a bullet point is found in the text, e.g.
textAnnotation
description
For example, here is one such annotation:
{ "boundingPoly": { "vertices": [ { "x": 365, "y": 749 }, { "x": 373, "y": 749 }, { "x": 373, "y": 780 }, { "x": 365, "y": 780 } ] } }
When this happens, gcv2hocr fails with the following output:
gcv2hocr
Traceback (most recent call last): File "/home/drj/.local/bin/gcv2hocr.py", line 166, in <module> page = fromResponse(resp, **args.__dict__) File "/home/drj/.local/bin/gcv2hocr.py", line 105, in fromResponse word = GCVAnnotation(ocr_class='ocrx_word', content=anno_json['description'], box=box) KeyError: 'description'
Occasionally, Cloud Vision will return a
textAnnotation
that has nodescription
. This can happen when a bullet point is found in the text, e.g.For example, here is one such annotation:
When this happens,
gcv2hocr
fails with the following output: