Bobholamovic
commited on
Commit
·
8d13862
1
Parent(s):
ee1547b
Remove timing logic
Browse files
app.py
CHANGED
|
@@ -20,8 +20,6 @@ def inference(img):
|
|
| 20 |
"Content-Type": "application/json",
|
| 21 |
}
|
| 22 |
|
| 23 |
-
import time
|
| 24 |
-
t1 = time.time()
|
| 25 |
response = requests.post(
|
| 26 |
API_URL,
|
| 27 |
json={
|
|
@@ -33,15 +31,12 @@ def inference(img):
|
|
| 33 |
headers=headers,
|
| 34 |
timeout=1000,
|
| 35 |
)
|
| 36 |
-
print("t1", time.time()-t1, flush=True)
|
| 37 |
response.raise_for_status()
|
| 38 |
|
| 39 |
result = response.json()
|
| 40 |
ocr_img_url = result["result"]["ocrResults"][0]["ocrImage"]
|
| 41 |
|
| 42 |
-
t2 = time.time()
|
| 43 |
response = requests.get(ocr_img_url, timeout=10)
|
| 44 |
-
print("t2", time.time()-t2, flush=True)
|
| 45 |
response.raise_for_status()
|
| 46 |
ocr_img_base64 = Image.open(io.BytesIO(response.content))
|
| 47 |
|
|
|
|
| 20 |
"Content-Type": "application/json",
|
| 21 |
}
|
| 22 |
|
|
|
|
|
|
|
| 23 |
response = requests.post(
|
| 24 |
API_URL,
|
| 25 |
json={
|
|
|
|
| 31 |
headers=headers,
|
| 32 |
timeout=1000,
|
| 33 |
)
|
|
|
|
| 34 |
response.raise_for_status()
|
| 35 |
|
| 36 |
result = response.json()
|
| 37 |
ocr_img_url = result["result"]["ocrResults"][0]["ocrImage"]
|
| 38 |
|
|
|
|
| 39 |
response = requests.get(ocr_img_url, timeout=10)
|
|
|
|
| 40 |
response.raise_for_status()
|
| 41 |
ocr_img_base64 = Image.open(io.BytesIO(response.content))
|
| 42 |
|