Spaces:
Sleeping
Sleeping
tonyliu404
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -228,6 +228,10 @@ class_names = [
|
|
228 |
"tuna_tartare", "waffles"
|
229 |
]
|
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
|
|
|
228 |
"tuna_tartare", "waffles"
|
229 |
]
|
230 |
|
231 |
+
def softmax_with_temperature(logits, temperature=1.0):
|
232 |
+
logits = logits / temperature
|
233 |
+
return tf.nn.softmax(logits)
|
234 |
+
|
235 |
def classifyImage(input_image):
|
236 |
input_image = input_image.resize((img_size, img_size))
|
237 |
input_array = tf.keras.utils.img_to_array(input_image) / 255.0
|