Duy-NM
commited on
Commit
·
b847fc0
1
Parent(s):
ba54dd8
update face
Browse files
app.py
CHANGED
@@ -11,7 +11,7 @@ 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)
|
17 |
return im_path, jss
|
@@ -56,9 +56,9 @@ with gr.Blocks() as face_analyze:
|
|
56 |
with gr.Row():
|
57 |
with gr.Column():
|
58 |
area = gr.Radio(["Asia", "Europe/America"], label="Area?", value="Asia")
|
59 |
-
cb_age = gr.Checkbox(label="Age")
|
60 |
-
cb_gender = gr.Checkbox(label="Gender")
|
61 |
-
cb_emotion = gr.Checkbox(label="Emotion")
|
62 |
sl = gr.Slider(0, 1, step=0.05, value=0.65, label='Confidence Threshold')
|
63 |
|
64 |
with gr.Column():
|
|
|
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, area, f_age, f_gender, f_emotion, fn_index=1)
|
15 |
with open(jj) as f:
|
16 |
jss = json.load(f)
|
17 |
return im_path, jss
|
|
|
56 |
with gr.Row():
|
57 |
with gr.Column():
|
58 |
area = gr.Radio(["Asia", "Europe/America"], label="Area?", value="Asia")
|
59 |
+
cb_age = gr.Checkbox(label="Age", value=True)
|
60 |
+
cb_gender = gr.Checkbox(label="Gender", value=True)
|
61 |
+
cb_emotion = gr.Checkbox(label="Emotion", value=True)
|
62 |
sl = gr.Slider(0, 1, step=0.05, value=0.65, label='Confidence Threshold')
|
63 |
|
64 |
with gr.Column():
|