app.py
CHANGED
@@ -52,8 +52,8 @@ def process_file(f):
|
|
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")
|
@@ -65,12 +65,12 @@ 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 |
|
71 |
demo = gr.TabbedInterface(
|
72 |
#[tab1, tab2, tab3], ["Image Upload", "URL Input", "File Output"], title="Background Removal Tool"
|
73 |
-
[tab1, tab2], ["Image Input", "URL Input"], title="Background
|
74 |
|
75 |
)
|
76 |
|
|
|
52 |
transparent.save(name_path)
|
53 |
return name_path
|
54 |
|
55 |
+
slider1 = ImageSlider(label="Original VS AI Processed", type="pil")
|
56 |
+
slider2 = ImageSlider(label="Original VS AI 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")
|
|
|
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, download_button], 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 |
|
71 |
demo = gr.TabbedInterface(
|
72 |
#[tab1, tab2, tab3], ["Image Upload", "URL Input", "File Output"], title="Background Removal Tool"
|
73 |
+
[tab1, tab2], ["Image Input", "URL Input"], title="AI Background Remover Pro"
|
74 |
|
75 |
)
|
76 |
|