Ahsen Khaliq commited on
Commit
a01ad06
1 Parent(s): 8a6d741

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -8
app.py CHANGED
@@ -9,9 +9,7 @@ from PIL import Image
9
  import numpy as np
10
  os.mkdir("data")
11
  os.mkdir("dataout")
12
- # Images
13
- torch.hub.download_url_to_file('https://cdn.pixabay.com/photo/2018/08/12/16/59/ara-3601194_1280.jpg', 'parrot.jpg')
14
- torch.hub.download_url_to_file('https://cdn.pixabay.com/photo/2016/10/21/14/46/fox-1758183_1280.jpg', 'fox.jpg')
15
  model = hub.Module(name='U2Net')
16
  def infer(img):
17
  img.save("./data/data.png")
@@ -31,11 +29,10 @@ def infer(img):
31
  return "./dataout/data_mask.png"
32
  inputs = gr.inputs.Image(type='pil', label="Original Image")
33
  outputs = gr.outputs.Image(type="file",label="output")
34
- title = "U^2-Net"
35
- description = "demo for U^2-Net. To use it, simply upload your image, or click one of the examples to load them. Read more at the links below."
36
- article = "<p style='text-align: center'><a href='https://arxiv.org/abs/2005.09007'>U^2-Net: Going Deeper with Nested U-Structure for Salient Object Detection</a> | <a href='https://github.com/xuebinqin/U-2-Net'>Github Repo</a></p>"
37
  examples = [
38
- ['fox.jpg'],
39
- ['parrot.jpg']
40
  ]
41
  gr.Interface(infer, inputs, outputs, title=title, description=description, article=article, examples=examples).launch()
 
9
  import numpy as np
10
  os.mkdir("data")
11
  os.mkdir("dataout")
12
+ torch.hub.download_url_to_file('https://images.pexels.com/photos/103123/pexels-photo-103123.jpeg', 'person.jpeg')
 
 
13
  model = hub.Module(name='U2Net')
14
  def infer(img):
15
  img.save("./data/data.png")
 
29
  return "./dataout/data_mask.png"
30
  inputs = gr.inputs.Image(type='pil', label="Original Image")
31
  outputs = gr.outputs.Image(type="file",label="output")
32
+ title = "LaMa Image Inpainting"
33
+ description = "Gradio demo for LaMa: Resolution-robust Large Mask Inpainting with Fourier Convolutions. To use it, simply upload your image, or click one of the examples to load them. Read more at the links below."
34
+ article = "<p style='text-align: center'><a href='https://arxiv.org/abs/2109.07161' target='_blank'>Resolution-robust Large Mask Inpainting with Fourier Convolutions</a> | <a href='https://github.com/saic-mdal/lama' target='_blank'>Github Repo</a></p>"
35
  examples = [
36
+ ['person.jpeg']
 
37
  ]
38
  gr.Interface(infer, inputs, outputs, title=title, description=description, article=article, examples=examples).launch()