sariyam commited on
Commit
9352739
Β·
verified Β·
1 Parent(s): 5e17140
Files changed (1) hide show
  1. app.py +5 -2
app.py CHANGED
@@ -26,7 +26,10 @@ def fn(image):
26
  im = im.convert("RGB")
27
  origin = im.copy()
28
  processed_image = process(im)
29
- return (processed_image, origin)
 
 
 
30
 
31
  @spaces.GPU
32
  def process(image):
@@ -61,7 +64,7 @@ output_file = gr.File(label="Output PNG File")
61
  chameleon = load_img("butterfly.jpg", output_type="pil")
62
  url_example = "https://hips.hearstapps.com/hmg-prod/images/gettyimages-1229892983-square.jpg"
63
 
64
- tab1 = gr.Interface(fn, inputs=image_upload, outputs=[slider1 , output_file], examples=[chameleon], api_name="image")
65
  tab2 = gr.Interface(fn, inputs=url_input, outputs=slider2, examples=[url_example], api_name="text")
66
  tab3 = gr.Interface(process_file, inputs=image_file_upload, outputs=output_file, examples=["butterfly.jpg"], api_name="png")
67
 
 
26
  im = im.convert("RGB")
27
  origin = im.copy()
28
  processed_image = process(im)
29
+
30
+ name_path = "output.png"
31
+ transparent.save(name_path)
32
+ return (processed_image, name_path)
33
 
34
  @spaces.GPU
35
  def process(image):
 
64
  chameleon = load_img("butterfly.jpg", output_type="pil")
65
  url_example = "https://hips.hearstapps.com/hmg-prod/images/gettyimages-1229892983-square.jpg"
66
 
67
+ tab1 = gr.Interface(fn, inputs=image_upload, outputs= slider1, examples=[chameleon], api_name="image")
68
  tab2 = gr.Interface(fn, inputs=url_input, outputs=slider2, examples=[url_example], api_name="text")
69
  tab3 = gr.Interface(process_file, inputs=image_file_upload, outputs=output_file, examples=["butterfly.jpg"], api_name="png")
70