Update app.py
Browse files
app.py
CHANGED
@@ -5,7 +5,7 @@ from io import BytesIO
|
|
5 |
import numpy as np
|
6 |
|
7 |
# Load the image from the URL
|
8 |
-
input_image_url = "https://raw.githubusercontent.com/xoghd1126/G4-finalproject/main
|
9 |
response = requests.get(input_image_url)
|
10 |
image = Image.open(BytesIO(response.content))
|
11 |
|
@@ -13,20 +13,20 @@ image = Image.open(BytesIO(response.content))
|
|
13 |
image_np = np.array(image)
|
14 |
|
15 |
# URL of the output image
|
16 |
-
output_image_url = "https://raw.githubusercontent.com/xoghd1126/G4-finalproject/main
|
17 |
|
18 |
# Function to process the drawing (dummy processing)
|
19 |
def process_drawing(drawing):
|
20 |
# Fetch the output image
|
21 |
response = requests.get(output_image_url)
|
22 |
output_image = Image.open(BytesIO(response.content))
|
23 |
-
|
24 |
return output_image
|
25 |
|
26 |
# Create Gradio interface
|
27 |
def create_interface():
|
28 |
sketchpad = gr.Sketchpad(label="Draw lines to match items", type="numpy", value=image_np)
|
29 |
-
|
30 |
interface = gr.Interface(
|
31 |
fn=process_drawing,
|
32 |
inputs=[sketchpad],
|
|
|
5 |
import numpy as np
|
6 |
|
7 |
# Load the image from the URL
|
8 |
+
input_image_url = "https://raw.githubusercontent.com/xoghd1126/G4-finalproject/main/Slide-1.png"
|
9 |
response = requests.get(input_image_url)
|
10 |
image = Image.open(BytesIO(response.content))
|
11 |
|
|
|
13 |
image_np = np.array(image)
|
14 |
|
15 |
# URL of the output image
|
16 |
+
output_image_url = "https://raw.githubusercontent.com/xoghd1126/G4-finalproject/main/Slide-2.png"
|
17 |
|
18 |
# Function to process the drawing (dummy processing)
|
19 |
def process_drawing(drawing):
|
20 |
# Fetch the output image
|
21 |
response = requests.get(output_image_url)
|
22 |
output_image = Image.open(BytesIO(response.content))
|
23 |
+
|
24 |
return output_image
|
25 |
|
26 |
# Create Gradio interface
|
27 |
def create_interface():
|
28 |
sketchpad = gr.Sketchpad(label="Draw lines to match items", type="numpy", value=image_np)
|
29 |
+
|
30 |
interface = gr.Interface(
|
31 |
fn=process_drawing,
|
32 |
inputs=[sketchpad],
|