Spaces:
Runtime error
Runtime error
Upload folder using huggingface_hub
Browse files
app.py
CHANGED
|
@@ -9,14 +9,14 @@ def index(image_url):
|
|
| 9 |
result = reader.readtext(image_url)
|
| 10 |
|
| 11 |
texts = []
|
| 12 |
-
probs = []
|
| 13 |
|
| 14 |
for (bbox, text, prob) in result:
|
| 15 |
# print(f'Text: {text}, Probability: {prob}')
|
| 16 |
texts.append(text)
|
| 17 |
-
probs.append(prob)
|
| 18 |
|
| 19 |
-
output_dict = {"texts": texts
|
| 20 |
output_json = json.dumps(output_dict)
|
| 21 |
|
| 22 |
return output_json
|
|
|
|
| 9 |
result = reader.readtext(image_url)
|
| 10 |
|
| 11 |
texts = []
|
| 12 |
+
# probs = []
|
| 13 |
|
| 14 |
for (bbox, text, prob) in result:
|
| 15 |
# print(f'Text: {text}, Probability: {prob}')
|
| 16 |
texts.append(text)
|
| 17 |
+
# probs.append(prob)
|
| 18 |
|
| 19 |
+
output_dict = {"texts": texts}
|
| 20 |
output_json = json.dumps(output_dict)
|
| 21 |
|
| 22 |
return output_json
|