Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -11,8 +11,8 @@ edges2ferrets = './edges2ferrets_model.h5'
|
|
| 11 |
ferretMaker = tf.keras.models.load_model(edges2ferrets)
|
| 12 |
|
| 13 |
def transform_image(img, input_type):
|
| 14 |
-
sigma = 1.
|
| 15 |
-
if input_type == "
|
| 16 |
# Resize the input photo to 256x256
|
| 17 |
img = cv2.resize(img, (256, 256))
|
| 18 |
|
|
@@ -23,7 +23,7 @@ def transform_image(img, input_type):
|
|
| 23 |
edges = (feature.canny(grey_img, sigma=sigma) * 255).astype(np.uint8)
|
| 24 |
processed_input = cv2.cvtColor(edges, cv2.COLOR_GRAY2RGB)
|
| 25 |
|
| 26 |
-
elif input_type == "
|
| 27 |
# Resize the input drawing to 256x256
|
| 28 |
img = cv2.resize(img, (256, 256))
|
| 29 |
|
|
|
|
| 11 |
ferretMaker = tf.keras.models.load_model(edges2ferrets)
|
| 12 |
|
| 13 |
def transform_image(img, input_type):
|
| 14 |
+
sigma = 1.7 # Placeholder value for sigma
|
| 15 |
+
if input_type == "Photo":
|
| 16 |
# Resize the input photo to 256x256
|
| 17 |
img = cv2.resize(img, (256, 256))
|
| 18 |
|
|
|
|
| 23 |
edges = (feature.canny(grey_img, sigma=sigma) * 255).astype(np.uint8)
|
| 24 |
processed_input = cv2.cvtColor(edges, cv2.COLOR_GRAY2RGB)
|
| 25 |
|
| 26 |
+
elif input_type == "Drawing":
|
| 27 |
# Resize the input drawing to 256x256
|
| 28 |
img = cv2.resize(img, (256, 256))
|
| 29 |
|