Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -2,17 +2,16 @@ import tensorflow as tf
|
|
| 2 |
import gradio as gr
|
| 3 |
import cv2
|
| 4 |
import numpy as np
|
| 5 |
-
from PIL import Image
|
| 6 |
from skimage import feature
|
| 7 |
|
| 8 |
# Model path...
|
| 9 |
-
edges2ferrets = './
|
| 10 |
|
| 11 |
# Load the Pix2Pix generator model
|
| 12 |
ferretMaker = tf.keras.models.load_model(edges2ferrets)
|
| 13 |
|
| 14 |
def transform_image(img, input_type):
|
| 15 |
-
sigma = 1.
|
| 16 |
if input_type == "photo":
|
| 17 |
# Resize the input photo to 256x256
|
| 18 |
img = cv2.resize(img, (256, 256))
|
|
@@ -43,7 +42,7 @@ def transform_image(img, input_type):
|
|
| 43 |
|
| 44 |
iface = gr.Interface(
|
| 45 |
fn=transform_image,
|
| 46 |
-
inputs=[gr.Image(type="numpy", image_mode="RGB"), gr.Radio(["
|
| 47 |
outputs=gr.Image(type="numpy", image_mode="RGB"),
|
| 48 |
live=True,
|
| 49 |
title="Edges2Ferrets generation!",
|
|
|
|
| 2 |
import gradio as gr
|
| 3 |
import cv2
|
| 4 |
import numpy as np
|
|
|
|
| 5 |
from skimage import feature
|
| 6 |
|
| 7 |
# Model path...
|
| 8 |
+
edges2ferrets = './edges2ferrets_model.h5'
|
| 9 |
|
| 10 |
# Load the Pix2Pix generator model
|
| 11 |
ferretMaker = tf.keras.models.load_model(edges2ferrets)
|
| 12 |
|
| 13 |
def transform_image(img, input_type):
|
| 14 |
+
sigma = 1.0 # Placeholder value for sigma
|
| 15 |
if input_type == "photo":
|
| 16 |
# Resize the input photo to 256x256
|
| 17 |
img = cv2.resize(img, (256, 256))
|
|
|
|
| 42 |
|
| 43 |
iface = gr.Interface(
|
| 44 |
fn=transform_image,
|
| 45 |
+
inputs=[gr.Image(type="numpy", image_mode="RGB"), gr.Radio(["Photo", "Drawing"], label="Select Input Type")],
|
| 46 |
outputs=gr.Image(type="numpy", image_mode="RGB"),
|
| 47 |
live=True,
|
| 48 |
title="Edges2Ferrets generation!",
|