Spaces:
Sleeping
Sleeping
tonyliu404
commited on
Update app.py
Browse files
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
|
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 |
|