Spaces:
Running
Running
paresh95
commited on
Commit
·
4915b46
1
Parent(s):
59ece0e
PS|Updated app to handle two functions
Browse files
app.py
CHANGED
@@ -2,16 +2,24 @@ import gradio as gr
|
|
2 |
from utils.face_texture import GetFaceTexture
|
3 |
from utils.face_symmetry import GetFaceSymmetry
|
4 |
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
)
|
|
|
10 |
|
11 |
iface = gr.Interface(
|
12 |
-
fn=
|
13 |
inputs=gr.inputs.Image(type="pil"),
|
14 |
-
outputs=[
|
|
|
|
|
|
|
|
|
|
|
|
|
15 |
)
|
16 |
|
17 |
iface.launch()
|
|
|
|
2 |
from utils.face_texture import GetFaceTexture
|
3 |
from utils.face_symmetry import GetFaceSymmetry
|
4 |
|
5 |
+
|
6 |
+
def combined_fn(input_image):
|
7 |
+
texture_results = GetFaceTexture().main(input_image)
|
8 |
+
symmetry_results = GetFaceSymmetry().main(input_image)
|
9 |
+
return (*texture_results, *symmetry_results)
|
10 |
+
|
11 |
|
12 |
iface = gr.Interface(
|
13 |
+
fn=combined_fn,
|
14 |
inputs=gr.inputs.Image(type="pil"),
|
15 |
+
outputs=[
|
16 |
+
gr.outputs.Image(type="pil"), # From GetFaceTexture
|
17 |
+
gr.outputs.Image(type="pil"), # From GetFaceTexture
|
18 |
+
"text", # From GetFaceTexture
|
19 |
+
gr.outputs.Image(type="pil"), # From GetFaceSymmetry
|
20 |
+
"text" # From GetFaceSymmetry
|
21 |
+
]
|
22 |
)
|
23 |
|
24 |
iface.launch()
|
25 |
+
|