tommy24 commited on
Commit
8174147
·
1 Parent(s): b18ae63

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -729,7 +729,6 @@ data = None
729
  np.set_printoptions(suppress=True)
730
 
731
  model = tf.keras.models.load_model('keras_model.h5')
732
- data = np.ndarray(shape=(1, 224, 224, 3), dtype=np.float32)
733
 
734
  with open("labels.txt", "r") as file:
735
  labels = file.read().splitlines()
@@ -845,6 +844,7 @@ def classify(platform, UserInput, Images, Textbox2, Textbox3):
845
  image = cv.resize(image, (224, 224))
846
  image_array = np.asarray(image)
847
  normalized_image_array = (image_array.astype(np.float32) / 127.0) - 1
 
848
  data[0] = normalized_image_array
849
 
850
  prediction = model.predict(data)
 
729
  np.set_printoptions(suppress=True)
730
 
731
  model = tf.keras.models.load_model('keras_model.h5')
 
732
 
733
  with open("labels.txt", "r") as file:
734
  labels = file.read().splitlines()
 
844
  image = cv.resize(image, (224, 224))
845
  image_array = np.asarray(image)
846
  normalized_image_array = (image_array.astype(np.float32) / 127.0) - 1
847
+ data = np.ndarray(shape=(1, 224, 224, 3), dtype=np.float32)
848
  data[0] = normalized_image_array
849
 
850
  prediction = model.predict(data)