MuGeminorum commited on
Commit
d2c8095
1 Parent(s): 557afb5
Files changed (1) hide show
  1. app.py +6 -7
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://www.modelscope.cn/api/v1/models/monetjoe/human-detector/repo?Revision=master&FilePath="
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='上传照片', type='filepath'),
94
  outputs=[
95
- gr.Image(label='检测结果', type='numpy'),
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()