nahidalam commited on
Commit
36e14c6
·
1 Parent(s): b86c944

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -28,16 +28,16 @@ def predict_and_save(img, generator_model):
28
 
29
  def run(image_path):
30
  model = tf.keras.models.load_model('pretrained')
 
31
  img = tf.keras.preprocessing.image.load_img(
32
  image_path, target_size=(256, 256)
33
  )
34
 
35
- #https://www.tensorflow.org/api_docs/python/tf/keras/utils/load_img
36
-
37
  img_array = tf.keras.preprocessing.image.img_to_array(img)
38
  img_array = tf.expand_dims(img_array, 0)
39
-
40
- predict_and_save(img_array, model)
 
41
 
42
  iface = gr.Interface(run, gr.inputs.Image(shape=(256, 256)), "image")
43
 
 
28
 
29
  def run(image_path):
30
  model = tf.keras.models.load_model('pretrained')
31
+ '''
32
  img = tf.keras.preprocessing.image.load_img(
33
  image_path, target_size=(256, 256)
34
  )
35
 
 
 
36
  img_array = tf.keras.preprocessing.image.img_to_array(img)
37
  img_array = tf.expand_dims(img_array, 0)
38
+ '''
39
+ #predict_and_save(img_array, model)
40
+ predict_and_save(image_path, model)
41
 
42
  iface = gr.Interface(run, gr.inputs.Image(shape=(256, 256)), "image")
43