app.py
CHANGED
|
@@ -52,20 +52,22 @@ def process_file(f):
|
|
| 52 |
transparent.save(name_path)
|
| 53 |
return name_path
|
| 54 |
|
| 55 |
-
slider1 = ImageSlider(label="Original
|
| 56 |
-
slider2 = ImageSlider(label="Original
|
| 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")
|
|
|
|
|
|
|
| 62 |
|
| 63 |
# Example images
|
| 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 |
|
| 71 |
demo = gr.TabbedInterface(
|
|
|
|
| 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")
|
| 60 |
output_file = gr.File(label="Output PNG File")
|
| 61 |
download_button = gr.File(label="Download")
|
| 62 |
+
download_button2 = gr.File(label="Download")
|
| 63 |
+
|
| 64 |
|
| 65 |
# Example images
|
| 66 |
chameleon = load_img("butterfly.jpg", output_type="pil")
|
| 67 |
url_example = "https://hips.hearstapps.com/hmg-prod/images/gettyimages-1229892983-square.jpg"
|
| 68 |
|
| 69 |
tab1 = gr.Interface(fn, inputs=image_upload, outputs= [slider1 , download_button], examples=[chameleon], api_name="image")
|
| 70 |
+
tab2 = gr.Interface(fn, inputs=url_input, outputs=[slider2 ,download_button2] , examples=[url_example], api_name="text")
|
| 71 |
#tab3 = gr.Interface(process_file, inputs=image_file_upload, outputs=output_file, examples=["butterfly.jpg"], api_name="png")
|
| 72 |
|
| 73 |
demo = gr.TabbedInterface(
|