File size: 886 Bytes
5e8395e
e5ce3a7
59ece0e
54e742e
1ed5ce5
4915b46
 
 
 
54e742e
 
4915b46
5e8395e
59ece0e
4915b46
59ece0e
4915b46
 
 
54e742e
4915b46
54e742e
 
 
59ece0e
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import gradio as gr
from utils.face_texture import GetFaceTexture
from utils.face_symmetry import GetFaceSymmetry
from utils.face_demographics import GetFaceDemographics


def combined_fn(input_image):
    texture_results = GetFaceTexture().main(input_image)
    symmetry_results = GetFaceSymmetry().main(input_image)
    demographics_results = GetFaceDemographics().main(input_image)
    return (*texture_results, *symmetry_results, demographics_results)


iface = gr.Interface(
    fn=combined_fn,
    inputs=gr.inputs.Image(type="pil"),
    outputs=[
        gr.outputs.Image(type="pil"),  # From GetFaceTexture
        gr.outputs.Image(type="pil"),  # From GetFaceTexture
        "text",  # From GetFaceTexture
        gr.outputs.Image(type="pil"),  # From GetFaceSymmetry
        "text",  # From GetFaceSymmetry
        "text",  # From GetFaceDemographics
    ],
)

iface.launch()