Rooni commited on
Commit
4bf97fc
1 Parent(s): 2419835

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -5
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 = gr.Image(label="Processed Image", type="filepath")
69
- slider1_origin = gr.Image(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,8 +77,8 @@ tab1 = gr.Interface(
77
  )
78
 
79
  # Tab 2: URL Input
80
- slider2_processed = gr.Image(label="Processed Image", type="filepath")
81
- slider2_origin = gr.Image(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,
 
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,