Spaces:
Sleeping
Sleeping
Update
Browse files
app.py
CHANGED
@@ -21,7 +21,6 @@ def compare_face(frame1, frame2):
|
|
21 |
res1 = r.json().get('image1')
|
22 |
if res1 is not None:
|
23 |
face = res1.get('detection')
|
24 |
-
print("--------------", face)
|
25 |
x1 = face.get('x')
|
26 |
y1 = face.get('y')
|
27 |
x2 = x1 + face.get('w')
|
@@ -45,7 +44,6 @@ def compare_face(frame1, frame2):
|
|
45 |
res2 = r.json().get('image2')
|
46 |
if res2 is not None:
|
47 |
face = res2.get('detection')
|
48 |
-
print("++++++++++--------------", face)
|
49 |
x1 = face.get('x')
|
50 |
y1 = face.get('y')
|
51 |
x2 = x1 + face.get('w')
|
@@ -90,6 +88,7 @@ def compare_face(frame1, frame2):
|
|
90 |
return [r.json(), [face1, face2]]
|
91 |
|
92 |
with gr.Blocks(theme='aliabid94/new-theme') as demo:
|
|
|
93 |
demo.load(
|
94 |
None,
|
95 |
None,
|
@@ -101,19 +100,19 @@ with gr.Blocks(theme='aliabid94/new-theme') as demo:
|
|
101 |
window.location.search = params.toString();
|
102 |
}
|
103 |
}""",
|
104 |
-
)
|
105 |
with gr.Row():
|
106 |
with gr.Column():
|
107 |
compare_face_input1 = gr.Image(label="Image1", type='filepath', height=480)
|
108 |
gr.Examples(['examples/1.jpg', 'examples/2.jpg'],
|
109 |
inputs=compare_face_input1)
|
110 |
-
compare_face_button = gr.Button("
|
111 |
with gr.Column():
|
112 |
compare_face_input2 = gr.Image(label="Image2", type='filepath', height=480)
|
113 |
gr.Examples(['examples/3.jpg', 'examples/4.jpg'],
|
114 |
inputs=compare_face_input2)
|
115 |
with gr.Column():
|
116 |
-
compare_face_output = gr.Gallery(label="Faces", height=
|
117 |
compare_result_output = gr.JSON(label='Result')
|
118 |
|
119 |
compare_face_button.click(compare_face, inputs=[compare_face_input1, compare_face_input2], outputs=[compare_result_output, compare_face_output])
|
|
|
21 |
res1 = r.json().get('image1')
|
22 |
if res1 is not None:
|
23 |
face = res1.get('detection')
|
|
|
24 |
x1 = face.get('x')
|
25 |
y1 = face.get('y')
|
26 |
x2 = x1 + face.get('w')
|
|
|
44 |
res2 = r.json().get('image2')
|
45 |
if res2 is not None:
|
46 |
face = res2.get('detection')
|
|
|
47 |
x1 = face.get('x')
|
48 |
y1 = face.get('y')
|
49 |
x2 = x1 + face.get('w')
|
|
|
88 |
return [r.json(), [face1, face2]]
|
89 |
|
90 |
with gr.Blocks(theme='aliabid94/new-theme') as demo:
|
91 |
+
'''
|
92 |
demo.load(
|
93 |
None,
|
94 |
None,
|
|
|
100 |
window.location.search = params.toString();
|
101 |
}
|
102 |
}""",
|
103 |
+
)'''
|
104 |
with gr.Row():
|
105 |
with gr.Column():
|
106 |
compare_face_input1 = gr.Image(label="Image1", type='filepath', height=480)
|
107 |
gr.Examples(['examples/1.jpg', 'examples/2.jpg'],
|
108 |
inputs=compare_face_input1)
|
109 |
+
compare_face_button = gr.Button("Face Anaylysis & Verification")
|
110 |
with gr.Column():
|
111 |
compare_face_input2 = gr.Image(label="Image2", type='filepath', height=480)
|
112 |
gr.Examples(['examples/3.jpg', 'examples/4.jpg'],
|
113 |
inputs=compare_face_input2)
|
114 |
with gr.Column():
|
115 |
+
compare_face_output = gr.Gallery(label="Faces", height=230, columns=[2], rows=[1])
|
116 |
compare_result_output = gr.JSON(label='Result')
|
117 |
|
118 |
compare_face_button.click(compare_face, inputs=[compare_face_input1, compare_face_input2], outputs=[compare_result_output, compare_face_output])
|