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("
") img1=gr.Image(type='filepath',tool=['editor', 'select'],show_label=False ) gr.HTML("
") # out = gr.Textbox() out=gr.Label(show_label=False) gr.HTML("
") 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)