joheras commited on
Commit
963d24d
1 Parent(s): f963ea2
Files changed (1) hide show
  1. app.py +5 -5
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(image_path):
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(base_image_path):
99
- original_img = preprocess_image(base_image_path)
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]