OriLib commited on
Commit
5068bdc
1 Parent(s): cbe790c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -5
app.py CHANGED
@@ -25,7 +25,8 @@ def fn(image):
25
  im = im.convert("RGB")
26
  origin = im.copy()
27
  image = process(im)
28
- return (image, origin)
 
29
 
30
  @spaces.GPU
31
  def process(image):
@@ -61,15 +62,15 @@ chameleon = load_img("giraffe.jpg", output_type="pil")
61
  url = "http://farm9.staticflickr.com/8488/8228323072_76eeddfea3_z.jpg"
62
 
63
  tab1 = gr.Interface(
64
- fn, inputs=image, outputs=slider1, examples=[chameleon], api_name="image"
65
  )
66
 
67
- tab2 = gr.Interface(fn, inputs=text, outputs=slider2, examples=[url], api_name="text")
68
- tab3 = gr.Interface(process_file, inputs=image2, outputs=png_file, examples=["giraffe.jpg"], api_name="png")
69
 
70
 
71
  demo = gr.TabbedInterface(
72
- [tab1, tab2,tab3], ["input image", "input url","png output"], title="RMBG-2.0 for background removal"
73
  )
74
 
75
  if __name__ == "__main__":
 
25
  im = im.convert("RGB")
26
  origin = im.copy()
27
  image = process(im)
28
+ image_path = process_file(f)
29
+ return (image, origin), image_path
30
 
31
  @spaces.GPU
32
  def process(image):
 
62
  url = "http://farm9.staticflickr.com/8488/8228323072_76eeddfea3_z.jpg"
63
 
64
  tab1 = gr.Interface(
65
+ fn, inputs=image, outputs=[slider1, png_file], examples=[chameleon], api_name="image"
66
  )
67
 
68
+ tab2 = gr.Interface(fn, inputs=text, outputs=[slider2, png_file], examples=[url], api_name="text")
69
+ # tab3 = gr.Interface(process_file, inputs=image2, outputs=png_file, examples=["giraffe.jpg"], api_name="png")
70
 
71
 
72
  demo = gr.TabbedInterface(
73
+ [tab1, tab2], ["input image", "input url"], title="RMBG-2.0 for background removal"
74
  )
75
 
76
  if __name__ == "__main__":