tonyliu404 commited on
Commit
9562ed8
·
verified ·
1 Parent(s): 2a9e1bc

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -0
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