yourusername commited on
Commit
04c3eda
Β·
1 Parent(s): f63e6a9

:art: move hf_hub_download call

Browse files
Files changed (1) hide show
  1. app.py +7 -10
app.py CHANGED
@@ -93,20 +93,17 @@ title = "MODNet Background Remover"
93
  description = "Gradio demo for MODNet, a model that can remove the background from a given image. To use it, simply upload your image, or click one of the examples to load them. Read more at the links below."
94
  article = "<div style='text-align: center;'> <a href='https://github.com/ZHKKKe/MODNet' target='_blank'>Github Repo</a> | <a href='https://arxiv.org/abs/2011.11961' target='_blank'>MODNet: Real-Time Trimap-Free Portrait Matting via Objective Decomposition</a> </div>"
95
 
 
 
 
 
 
 
96
  interface = gr.Interface(
97
  fn=main,
98
  inputs=gr.inputs.Image(type='filepath'),
99
  outputs='image',
100
- examples=[
101
- [
102
- hf_hub_download(
103
- 'nateraw/background-remover-files',
104
- 'twitter_profile_pic.jpeg',
105
- repo_type='dataset',
106
- force_filename='twitter_profile_pic.jpeg',
107
- )
108
- ]
109
- ],
110
  title=title,
111
  description=description,
112
  article=article,
 
93
  description = "Gradio demo for MODNet, a model that can remove the background from a given image. To use it, simply upload your image, or click one of the examples to load them. Read more at the links below."
94
  article = "<div style='text-align: center;'> <a href='https://github.com/ZHKKKe/MODNet' target='_blank'>Github Repo</a> | <a href='https://arxiv.org/abs/2011.11961' target='_blank'>MODNet: Real-Time Trimap-Free Portrait Matting via Objective Decomposition</a> </div>"
95
 
96
+ example_img = hf_hub_download(
97
+ 'nateraw/background-remover-files',
98
+ 'twitter_profile_pic.jpeg',
99
+ repo_type='dataset',
100
+ )
101
+
102
  interface = gr.Interface(
103
  fn=main,
104
  inputs=gr.inputs.Image(type='filepath'),
105
  outputs='image',
106
+ examples=[[example_img]],
 
 
 
 
 
 
 
 
 
107
  title=title,
108
  description=description,
109
  article=article,