Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,7 +1,36 @@
|
|
| 1 |
import gradio as gr
|
|
|
|
|
|
|
|
|
|
| 2 |
|
| 3 |
def greet(name):
|
| 4 |
return "Hello " + name + "!!"
|
| 5 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 6 |
iface = gr.Interface(fn=greet, inputs="text", outputs="text")
|
| 7 |
-
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
+
from inaFaceAnalyzer.inaFaceAnalyzer import ImageAnalyzer
|
| 3 |
+
import pandas as pd
|
| 4 |
+
|
| 5 |
|
| 6 |
def greet(name):
|
| 7 |
return "Hello " + name + "!!"
|
| 8 |
|
| 9 |
+
def fonc(img):
|
| 10 |
+
|
| 11 |
+
# create an image analyzer engine instance
|
| 12 |
+
ia = ImageAnalyzer()
|
| 13 |
+
res=ia(img)
|
| 14 |
+
|
| 15 |
+
sexe=res["sex_label"][0]
|
| 16 |
+
age=res["age_label"][0]
|
| 17 |
+
age=int(age)-4
|
| 18 |
+
|
| 19 |
+
age=str(age)
|
| 20 |
+
|
| 21 |
+
return age
|
| 22 |
+
|
| 23 |
+
|
| 24 |
+
|
| 25 |
+
|
| 26 |
+
with gr.Blocks() as demo:
|
| 27 |
+
gr.Markdown("Start typing below and then click **Run** to see the output.")
|
| 28 |
+
img1=gr.Image()
|
| 29 |
+
inp = gr.Textbox(placeholder="What is your name?")
|
| 30 |
+
out = gr.Textbox()
|
| 31 |
+
btn = gr.Button("Run")
|
| 32 |
+
btn.click(fn=fonc, inputs=fonc, outputs=out)
|
| 33 |
+
|
| 34 |
+
|
| 35 |
iface = gr.Interface(fn=greet, inputs="text", outputs="text")
|
| 36 |
+
demo.launch()
|