Spaces:
Running
Running
MuGeminorum
commited on
Commit
•
d2c8095
1
Parent(s):
557afb5
translate
Browse files
app.py
CHANGED
@@ -29,7 +29,7 @@ class ValidImgDetector:
|
|
29 |
age_gender_file = "model_imdb_cross_person_4.22_99.46.pth.tar"
|
30 |
detector_path = f"./model/{detector_file}"
|
31 |
age_gender_path = f"./model/{age_gender_file}"
|
32 |
-
domain = "https://
|
33 |
download_file(f"{domain}{detector_file}", detector_path)
|
34 |
download_file(f"{domain}{age_gender_file}", age_gender_path)
|
35 |
|
@@ -90,15 +90,14 @@ def inference(photo):
|
|
90 |
|
91 |
iface = gr.Interface(
|
92 |
fn=inference,
|
93 |
-
inputs=gr.Image(label='
|
94 |
outputs=[
|
95 |
-
gr.Image(label='
|
96 |
-
gr.Textbox(label='
|
97 |
-
gr.Textbox(label='
|
98 |
-
gr.Textbox(label='
|
99 |
],
|
100 |
examples=get_jpg_files('./examples')
|
101 |
)
|
102 |
|
103 |
-
# 启动 Gradio 界面
|
104 |
iface.launch()
|
|
|
29 |
age_gender_file = "model_imdb_cross_person_4.22_99.46.pth.tar"
|
30 |
detector_path = f"./model/{detector_file}"
|
31 |
age_gender_path = f"./model/{age_gender_file}"
|
32 |
+
domain = "https://huggingface.co/monet-joe/human-detector/resolve/main/"
|
33 |
download_file(f"{domain}{detector_file}", detector_path)
|
34 |
download_file(f"{domain}{age_gender_file}", age_gender_path)
|
35 |
|
|
|
90 |
|
91 |
iface = gr.Interface(
|
92 |
fn=inference,
|
93 |
+
inputs=gr.Image(label='Upload photo', type='filepath'),
|
94 |
outputs=[
|
95 |
+
gr.Image(label='Detection result', type='numpy'),
|
96 |
+
gr.Textbox(label='Has child'),
|
97 |
+
gr.Textbox(label='Has female'),
|
98 |
+
gr.Textbox(label='Has male')
|
99 |
],
|
100 |
examples=get_jpg_files('./examples')
|
101 |
)
|
102 |
|
|
|
103 |
iface.launch()
|