Sa-m commited on
Commit
5a89ad8
1 Parent(s): 3b6db67

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -49,7 +49,7 @@ def classify_image(inp):
49
  inp = inp.reshape((-1, IMG_SIZE, IMG_SIZE, 3))
50
  inp = tf.keras.applications.vgg16.preprocess_input(inp)
51
  prediction = model.predict(inp).flatten()
52
- return {labels[i]: float(prediction[i]) for i in range(NUM_CLASSES)}
53
 
54
  # image = gr.inputs.Image(shape=(IMG_SIZE, IMG_SIZE))
55
  # label = gr.outputs.Label(num_top_classes=2)
 
49
  inp = inp.reshape((-1, IMG_SIZE, IMG_SIZE, 3))
50
  inp = tf.keras.applications.vgg16.preprocess_input(inp)
51
  prediction = model.predict(inp).flatten()
52
+ return {labels[i]: f"{prediction[i]:.6f}" for i in range(NUM_CLASSES)}
53
 
54
  # image = gr.inputs.Image(shape=(IMG_SIZE, IMG_SIZE))
55
  # label = gr.outputs.Label(num_top_classes=2)