Duy-NM
commited on
Commit
·
ba54dd8
1
Parent(s):
747c9e3
update face
Browse files
app.py
CHANGED
@@ -10,7 +10,7 @@ G = ['Female', 'Male']
|
|
10 |
token = os.environ['token']
|
11 |
client = Client("https://vtechai-face-demo.hf.space/", token)
|
12 |
|
13 |
-
def
|
14 |
im_path, jj = client.predict(im, conf, fn_index=1)
|
15 |
with open(jj) as f:
|
16 |
jss = json.load(f)
|
@@ -68,7 +68,7 @@ with gr.Blocks() as face_analyze:
|
|
68 |
btn = gr.Button(value="Run")
|
69 |
btn_clean = gr.ClearButton([im1, im2])
|
70 |
|
71 |
-
btn.click(fn=
|
72 |
btn2 = gr.Button(value="Check", link="https://manhduy160396.wixsite.com/vtech")
|
73 |
|
74 |
|
|
|
10 |
token = os.environ['token']
|
11 |
client = Client("https://vtechai-face-demo.hf.space/", token)
|
12 |
|
13 |
+
def analyze(im, conf=0.65, area="Asia", f_age=False, f_gender=False, f_emotion=False):
|
14 |
im_path, jj = client.predict(im, conf, fn_index=1)
|
15 |
with open(jj) as f:
|
16 |
jss = json.load(f)
|
|
|
68 |
btn = gr.Button(value="Run")
|
69 |
btn_clean = gr.ClearButton([im1, im2])
|
70 |
|
71 |
+
btn.click(fn=analyze, inputs=[im1, sl, area, cb_age, cb_gender, cb_emotion], outputs=[im2, js])
|
72 |
btn2 = gr.Button(value="Check", link="https://manhduy160396.wixsite.com/vtech")
|
73 |
|
74 |
|