Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
import gradio as gr
|
|
|
2 |
from gradio_client import Client, handle_file
|
3 |
from PIL import Image
|
4 |
-
import requests
|
5 |
import tempfile
|
6 |
import os
|
7 |
|
@@ -65,8 +65,8 @@ chameleon = "butterfly.jpg"
|
|
65 |
url_example = "https://hips.hearstapps.com/hmg-prod/images/gettyimages-1229892983-square.jpg"
|
66 |
|
67 |
# Tab 1: Image Upload
|
68 |
-
slider1_processed =
|
69 |
-
slider1_origin =
|
70 |
image_upload = gr.Image(label="Upload an image")
|
71 |
tab1 = gr.Interface(
|
72 |
fn=process_image_via_api,
|
@@ -77,8 +77,8 @@ tab1 = gr.Interface(
|
|
77 |
)
|
78 |
|
79 |
# Tab 2: URL Input
|
80 |
-
slider2_processed =
|
81 |
-
slider2_origin =
|
82 |
url_input = gr.Textbox(label="Paste an image URL")
|
83 |
tab2 = gr.Interface(
|
84 |
fn=process_url_via_api,
|
|
|
1 |
import gradio as gr
|
2 |
+
from gradio_imageslider import ImageSlider
|
3 |
from gradio_client import Client, handle_file
|
4 |
from PIL import Image
|
|
|
5 |
import tempfile
|
6 |
import os
|
7 |
|
|
|
65 |
url_example = "https://hips.hearstapps.com/hmg-prod/images/gettyimages-1229892983-square.jpg"
|
66 |
|
67 |
# Tab 1: Image Upload
|
68 |
+
slider1_processed = ImageSlider(label="Processed Image", type="filepath")
|
69 |
+
slider1_origin = ImageSlider(label="Original Image", type="filepath")
|
70 |
image_upload = gr.Image(label="Upload an image")
|
71 |
tab1 = gr.Interface(
|
72 |
fn=process_image_via_api,
|
|
|
77 |
)
|
78 |
|
79 |
# Tab 2: URL Input
|
80 |
+
slider2_processed = ImageSlider(label="Processed Image", type="filepath")
|
81 |
+
slider2_origin = ImageSlider(label="Original Image", type="filepath")
|
82 |
url_input = gr.Textbox(label="Paste an image URL")
|
83 |
tab2 = gr.Interface(
|
84 |
fn=process_url_via_api,
|