Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -22,10 +22,15 @@ def draw_boxes(image, bounds, color='yellow', width=2):
|
|
| 22 |
|
| 23 |
def inference(img, lang):
|
| 24 |
reader = easyocr.Reader(lang)
|
|
|
|
| 25 |
bounds = reader.readtext(img.name)
|
|
|
|
| 26 |
im = PIL.Image.open(img.name)
|
|
|
|
| 27 |
draw_boxes(im, bounds)
|
|
|
|
| 28 |
im.save('result.jpg')
|
|
|
|
| 29 |
return ['result.jpg', pd.DataFrame(bounds).iloc[: , 1:]]
|
| 30 |
|
| 31 |
title = 'EasyOCR'
|
|
|
|
| 22 |
|
| 23 |
def inference(img, lang):
|
| 24 |
reader = easyocr.Reader(lang)
|
| 25 |
+
print('reader created')
|
| 26 |
bounds = reader.readtext(img.name)
|
| 27 |
+
print('recognized')
|
| 28 |
im = PIL.Image.open(img.name)
|
| 29 |
+
print('start bb')
|
| 30 |
draw_boxes(im, bounds)
|
| 31 |
+
print('end bb')
|
| 32 |
im.save('result.jpg')
|
| 33 |
+
print('file saved')
|
| 34 |
return ['result.jpg', pd.DataFrame(bounds).iloc[: , 1:]]
|
| 35 |
|
| 36 |
title = 'EasyOCR'
|