Spaces:
Runtime error
Runtime error
Commit
Β·
7903e7a
1
Parent(s):
a943db9
Made changes to headers
Browse files
app.py
CHANGED
@@ -48,12 +48,7 @@ async def predict_image(img):
|
|
48 |
img_base64 = base64.b64encode(buffer.getvalue()).decode()
|
49 |
|
50 |
print(len(img_base64))
|
51 |
-
|
52 |
-
# img = Image.open(io.BytesIO(base64.b64decode(img_base64)))
|
53 |
-
# # img save
|
54 |
-
# img.save("img.jpg")
|
55 |
-
|
56 |
-
|
57 |
res = await spoof_trigger(img_base64)
|
58 |
# print(json.loads(res))
|
59 |
spoof_res = json.loads(res)['spoof_res']
|
@@ -62,18 +57,15 @@ async def predict_image(img):
|
|
62 |
|
63 |
# img_base64 to plot
|
64 |
img = Image.open(io.BytesIO(base64.b64decode(annotated_image)))
|
65 |
-
# img save
|
66 |
-
# img.save("cache/img.jpg")
|
67 |
-
|
68 |
confidences = {'Real': conf_score, 'Fake': 1-conf_score}
|
69 |
|
70 |
return (confidences,img)
|
71 |
|
72 |
|
73 |
with gr.Blocks(title="Spoof-Demo", css="#custom_header {min-height: 3rem; text-align: center} #custom_title {min-height: 3rem; text-align: center}") as demo :
|
74 |
-
gr.Markdown("
|
75 |
-
gr.Markdown("Gradio Demo for Face Antispoofing", elem_id="custom_header")
|
76 |
-
gr.Markdown("π¨βπ» Only fot research preview Intended")
|
77 |
with gr.Row():
|
78 |
with gr.Column():
|
79 |
with gr.Box():
|
|
|
48 |
img_base64 = base64.b64encode(buffer.getvalue()).decode()
|
49 |
|
50 |
print(len(img_base64))
|
51 |
+
|
|
|
|
|
|
|
|
|
|
|
52 |
res = await spoof_trigger(img_base64)
|
53 |
# print(json.loads(res))
|
54 |
spoof_res = json.loads(res)['spoof_res']
|
|
|
57 |
|
58 |
# img_base64 to plot
|
59 |
img = Image.open(io.BytesIO(base64.b64decode(annotated_image)))
|
|
|
|
|
|
|
60 |
confidences = {'Real': conf_score, 'Fake': 1-conf_score}
|
61 |
|
62 |
return (confidences,img)
|
63 |
|
64 |
|
65 |
with gr.Blocks(title="Spoof-Demo", css="#custom_header {min-height: 3rem; text-align: center} #custom_title {min-height: 3rem; text-align: center}") as demo :
|
66 |
+
gr.Markdown("# Face Antispoof-Demo", elem_id="custom_title")
|
67 |
+
gr.Markdown("## Gradio Demo for Face Antispoofing Detection using DeepPairNet based on ResNet50", elem_id="custom_header")
|
68 |
+
gr.Markdown("## π¨βπ» Only fot research preview Intended" ,elem_id="custom_header")
|
69 |
with gr.Row():
|
70 |
with gr.Column():
|
71 |
with gr.Box():
|