Spaces:
Runtime error
Runtime error
JustinLin610
commited on
Commit
•
c2b99e9
1
Parent(s):
6ebfea3
Update app.py
Browse files
app.py
CHANGED
@@ -27,9 +27,9 @@ def ocr(image):
|
|
27 |
|
28 |
response = requests.request("POST", url, headers=headers, data=payload)
|
29 |
jobj = json.loads(response.text)
|
30 |
-
out_img_base64 = jobj['
|
31 |
out_img = Image.open(BytesIO(base64.urlsafe_b64decode(out_img_base64)))
|
32 |
-
ocr_result = jobj['
|
33 |
|
34 |
result = pd.DataFrame(ocr_result, columns=['Box ID', 'Text'])
|
35 |
|
|
|
27 |
|
28 |
response = requests.request("POST", url, headers=headers, data=payload)
|
29 |
jobj = json.loads(response.text)
|
30 |
+
out_img_base64 = jobj['data'][0].replace('data:image/png;base64,','')
|
31 |
out_img = Image.open(BytesIO(base64.urlsafe_b64decode(out_img_base64)))
|
32 |
+
ocr_result = jobj['data'][1]['data']
|
33 |
|
34 |
result = pd.DataFrame(ocr_result, columns=['Box ID', 'Text'])
|
35 |
|