Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -87,7 +87,9 @@ def inference(filepath, lang, labels):
|
|
87 |
cropped_image = img[min_y:max_y,min_x:max_x] # crop the image
|
88 |
cropped_image = Image.fromarray(cropped_image)
|
89 |
out = recognitor.predict(cropped_image)
|
90 |
-
|
|
|
|
|
91 |
result = query(texts, labels)
|
92 |
jsonText = json.dumps(result)
|
93 |
im = PIL.Image.open(filepath)
|
|
|
87 |
cropped_image = img[min_y:max_y,min_x:max_x] # crop the image
|
88 |
cropped_image = Image.fromarray(cropped_image)
|
89 |
out = recognitor.predict(cropped_image)
|
90 |
+
corrected_out = acronym_correction(out)
|
91 |
+
print('correct from: '+ out + ' to: '+corrected_out)
|
92 |
+
texts = texts + '\t' + corrected_out
|
93 |
result = query(texts, labels)
|
94 |
jsonText = json.dumps(result)
|
95 |
im = PIL.Image.open(filepath)
|