Spaces:
Runtime error
Runtime error
app.py
Browse files
app.py
CHANGED
@@ -29,11 +29,11 @@ octave_scale = 1.4 # Size ratio between scales
|
|
29 |
iterations = 20 # Number of ascent steps per scale
|
30 |
max_loss = 15.0
|
31 |
|
32 |
-
def preprocess_image(
|
33 |
# Util function to open, resize and format pictures
|
34 |
# into appropriate arrays.
|
35 |
-
img = keras.preprocessing.image.load_img(image_path)
|
36 |
-
img = keras.preprocessing.image.img_to_array(img)
|
37 |
img = np.expand_dims(img, axis=0)
|
38 |
img = inception_v3.preprocess_input(img)
|
39 |
return img
|
@@ -95,8 +95,8 @@ def gradient_ascent_loop(img, iterations, learning_rate, max_loss=None):
|
|
95 |
return img
|
96 |
|
97 |
|
98 |
-
def process_image(
|
99 |
-
original_img = preprocess_image(
|
100 |
original_shape = original_img.shape[1:3]
|
101 |
|
102 |
successive_shapes = [original_shape]
|
|
|
29 |
iterations = 20 # Number of ascent steps per scale
|
30 |
max_loss = 15.0
|
31 |
|
32 |
+
def preprocess_image(img):
|
33 |
# Util function to open, resize and format pictures
|
34 |
# into appropriate arrays.
|
35 |
+
#img = keras.preprocessing.image.load_img(image_path)
|
36 |
+
#img = keras.preprocessing.image.img_to_array(img)
|
37 |
img = np.expand_dims(img, axis=0)
|
38 |
img = inception_v3.preprocess_input(img)
|
39 |
return img
|
|
|
95 |
return img
|
96 |
|
97 |
|
98 |
+
def process_image(img):
|
99 |
+
original_img = preprocess_image(img)
|
100 |
original_shape = original_img.shape[1:3]
|
101 |
|
102 |
successive_shapes = [original_shape]
|