File size: 1,168 Bytes
5e8395e
4eddd18
 
 
4ff0905
1ed5ce5
4915b46
 
 
 
54e742e
4ff0905
 
4915b46
5e8395e
59ece0e
4915b46
59ece0e
4915b46
 
 
54e742e
4915b46
54e742e
 
4ff0905
 
 
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
29
30
31
32
33
import gradio as gr
from src.face_texture import GetFaceTexture
from src.face_symmetry import GetFaceSymmetry
from src.face_demographics import GetFaceDemographics
from src.face_proportions import GetFaceProportions


def combined_fn(input_image):
    texture_results = GetFaceTexture().main(input_image)
    symmetry_results = GetFaceSymmetry().main(input_image)
    demographics_results = GetFaceDemographics().main(input_image)
    proportion_results = GetFaceProportions().main(input_image)
    return (*texture_results, *symmetry_results, demographics_results, *proportion_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
        "text",  # From GetFaceProportions
        "text",  # From GetFaceProportions
        gr.outputs.Image(type="pil"),  # From GetFaceProportions
    ],
)

iface.launch()