Spaces:
Sleeping
Sleeping
Minimal test version 2
Browse files- minimal_test_paddle.py +3 -1
minimal_test_paddle.py
CHANGED
|
@@ -76,7 +76,9 @@ def test_ocr():
|
|
| 76 |
if result and result[0]:
|
| 77 |
for detection in result[0]:
|
| 78 |
if len(detection) >= 2:
|
| 79 |
-
|
|
|
|
|
|
|
| 80 |
|
| 81 |
print(json.dumps({
|
| 82 |
"success": True,
|
|
|
|
| 76 |
if result and result[0]:
|
| 77 |
for detection in result[0]:
|
| 78 |
if len(detection) >= 2:
|
| 79 |
+
# Convert to string to handle both string and float values
|
| 80 |
+
text_value = str(detection[1][0]) if isinstance(detection[1], (list, tuple)) else str(detection[1])
|
| 81 |
+
text_found += text_value + "\n"
|
| 82 |
|
| 83 |
print(json.dumps({
|
| 84 |
"success": True,
|