tonyliu404 commited on
Commit
baab02c
·
verified ·
1 Parent(s): b2cbd6e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -230,13 +230,13 @@ class_names = [
230
 
231
  def classifyImage(input_image):
232
  input_image = input_image.resize((img_size, img_size))
233
- input_array = tf.keras.utils.img_to_array(input_image)
234
 
235
  # Add a batch dimension
236
  input_array = tf.expand_dims(input_array, 0) # (1, 224, 224, 3)
237
 
238
  predictions = model.predict(input_array)[0]
239
- print(f"Predictions BEFORE SOFTMAX: {predictions}")
240
  predictions = tf.nn.softmax(predictions).numpy()
241
  print(f"Predictions AFTER SOFTMAX: {predictions}")
242
 
 
230
 
231
  def classifyImage(input_image):
232
  input_image = input_image.resize((img_size, img_size))
233
+ input_array = tf.keras.utils.img_to_array(input_image) / 255.0
234
 
235
  # Add a batch dimension
236
  input_array = tf.expand_dims(input_array, 0) # (1, 224, 224, 3)
237
 
238
  predictions = model.predict(input_array)[0]
239
+ print(f"Predictions: {predictions}")
240
  predictions = tf.nn.softmax(predictions).numpy()
241
  print(f"Predictions AFTER SOFTMAX: {predictions}")
242