app.py
CHANGED
@@ -29,7 +29,7 @@ def fn(image):
|
|
29 |
|
30 |
name_path = "output.png"
|
31 |
processed_image.save(name_path)
|
32 |
-
return (origin, name_path
|
33 |
|
34 |
@spaces.GPU
|
35 |
def process(image):
|
@@ -52,10 +52,10 @@ def process_file(f):
|
|
52 |
transparent.save(name_path)
|
53 |
return name_path
|
54 |
|
55 |
-
slider1 = ImageSlider(label="Processed
|
56 |
-
slider2 = ImageSlider(label="
|
57 |
image_upload = gr.Image(label="Upload an image")
|
58 |
-
image_file_upload = gr.Image(label="Upload an image", type="filepath")
|
59 |
url_input = gr.Textbox(label="Paste an image URL")
|
60 |
output_file = gr.File(label="Output PNG File")
|
61 |
download_button = gr.File(label="Download")
|
@@ -64,7 +64,7 @@ download_button = gr.File(label="Download")
|
|
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 |
|
|
|
29 |
|
30 |
name_path = "output.png"
|
31 |
processed_image.save(name_path)
|
32 |
+
return (origin, processed_image) , name_path
|
33 |
|
34 |
@spaces.GPU
|
35 |
def process(image):
|
|
|
52 |
transparent.save(name_path)
|
53 |
return name_path
|
54 |
|
55 |
+
slider1 = ImageSlider(label="Original VS Processed", type="pil")
|
56 |
+
slider2 = ImageSlider(label="Original VS Processed", type="pil")
|
57 |
image_upload = gr.Image(label="Upload an image")
|
58 |
+
#image_file_upload = gr.Image(label="Upload an image", type="filepath")
|
59 |
url_input = gr.Textbox(label="Paste an image URL")
|
60 |
output_file = gr.File(label="Output PNG File")
|
61 |
download_button = gr.File(label="Download")
|
|
|
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 , download_button], 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 |
|