Update app.py
Browse files
app.py
CHANGED
|
@@ -4,15 +4,15 @@ import requests
|
|
| 4 |
import json
|
| 5 |
|
| 6 |
def check_id_liveness(frame):
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
|
| 17 |
# APP Interface
|
| 18 |
with gr.Blocks() as MiniAIdemo:
|
|
@@ -21,7 +21,7 @@ with gr.Blocks() as MiniAIdemo:
|
|
| 21 |
<a href="https://miniai.live" style="display: flex; align-items: center;">
|
| 22 |
<img src="https://miniai.live/wp-content/uploads/2024/02/logo_name-1-768x426-1.png" style="width: 18%; margin-right: 15px;"/>
|
| 23 |
<div>
|
| 24 |
-
<p style="font-size:
|
| 25 |
</div>
|
| 26 |
</a>
|
| 27 |
|
|
|
|
| 4 |
import json
|
| 5 |
|
| 6 |
def check_id_liveness(frame):
|
| 7 |
+
url = "http://191.96.31.183:8093/api/check_id_liveness"
|
| 8 |
+
files = {'image': open(frame, 'rb')}
|
| 9 |
+
try:
|
| 10 |
+
r = requests.post(url=url, files=files)
|
| 11 |
+
r.raise_for_status()
|
| 12 |
+
return json.dumps(r.json(), indent=2)
|
| 13 |
+
except requests.exceptions.RequestException as e:
|
| 14 |
+
return str(e)
|
| 15 |
+
|
| 16 |
|
| 17 |
# APP Interface
|
| 18 |
with gr.Blocks() as MiniAIdemo:
|
|
|
|
| 21 |
<a href="https://miniai.live" style="display: flex; align-items: center;">
|
| 22 |
<img src="https://miniai.live/wp-content/uploads/2024/02/logo_name-1-768x426-1.png" style="width: 18%; margin-right: 15px;"/>
|
| 23 |
<div>
|
| 24 |
+
<p style="font-size: 40px; font-weight: bold; margin-right: 20px;">ID Document Liveness Detection Demo</p>
|
| 25 |
</div>
|
| 26 |
</a>
|
| 27 |
|