-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.py
18 lines (15 loc) · 980 Bytes
/
app.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
import gradio as gr
from face_recog import detect_face
title = "Face Recognition"
desc = "Upload the pictures of 2 people you already know and also upload the picture that you want to identify"
examples = [["images/yannlecun.jpeg", "Yann Lecun", "images/yoshua_bengio.jpeg", "Yoshua Bengio", "images/yann_yoshua.jpg"],
["images/taylor.jpg", "Taylor Swift", "images/selena.jpg", "Selena Gomez", "images/taylorselena.jpg"]]
inputs = [gr.inputs.Image(label="Picture of Person 1", type="file"),
gr.inputs.Textbox(label="Name of Person 1"),
gr.inputs.Image(label="Picture of Person 2", type="file"),
gr.inputs.Textbox(label="Name of Person 2"),
gr.inputs.Image(label="Picture of Person 1 and 2", type="file")
]
outputs = gr.outputs.Image(label="Result", type="pil")
gr.Interface(fn=detect_face, inputs=inputs, outputs=outputs, title=title, description=desc,
examples=examples, allow_flagging=False).launch()