File size: 917 Bytes
15f81db
ab508d5
 
 
15f81db
 
 
 
ab508d5
 
 
 
 
 
 
 
 
 
 
 
835eac2
ab508d5
 
 
 
da1b636
9bca65f
 
eb43e35
a0b94bf
9c64515
ac823ec
6c27460
a0b94bf
ab508d5
499965f
ab508d5
 
ac823ec
7b0d0fe
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
34
35
36
37
38
39
40
import gradio as gr
from inaFaceAnalyzer.inaFaceAnalyzer import ImageAnalyzer
import pandas as pd


def greet(name):
    return "Hello " + name + "!!"

def fonc(img):
    
# create an image analyzer engine instance
    ia = ImageAnalyzer()
    res=ia(img)
    
    sexe=res["sex_label"][0]
    age=res["age_label"][0]
    age=int(age)-4

    age=str(age)

    return "Vous avez "+age+" ans"
    

        

with gr.Blocks(css="footer {visibility: hidden}") as demo:
  #  gr.Markdown("Start typing below and then click **Run** to see the output.")
  #  gr.HTML("<br>")
    img1=gr.Image(type='filepath',tool=['editor', 'select'],show_label=False )
    gr.HTML("<br>")
  
   # out = gr.Textbox()
    out=gr.Label(show_label=False)
    gr.HTML("<br>")
    btn = gr.Button("Run")
    btn.click(fn=fonc, inputs=img1, outputs=out)


#iface = gr.Interface(fn=greet, inputs="text", outputs="text")
demo.launch(show_api=False)