Spaces:
Runtime error
Runtime error
Updates
Browse files
app.py
CHANGED
@@ -156,12 +156,13 @@ def ocr_barcode():
|
|
156 |
ocrResult = TTVOcrBarCode(file_path.encode('utf-8'))
|
157 |
status = "ok"
|
158 |
if not ocrResult:
|
159 |
-
ocrResDict =
|
160 |
status = "error"
|
161 |
else:
|
162 |
ocrResDict = json.loads(ocrResult)
|
163 |
|
164 |
response = jsonify({"status": status, "data": ocrResDict})
|
|
|
165 |
|
166 |
os.remove(file_path)
|
167 |
|
|
|
156 |
ocrResult = TTVOcrBarCode(file_path.encode('utf-8'))
|
157 |
status = "ok"
|
158 |
if not ocrResult:
|
159 |
+
ocrResDict = {}
|
160 |
status = "error"
|
161 |
else:
|
162 |
ocrResDict = json.loads(ocrResult)
|
163 |
|
164 |
response = jsonify({"status": status, "data": ocrResDict})
|
165 |
+
print("@@@@@", response)
|
166 |
|
167 |
os.remove(file_path)
|
168 |
|