Spaces:
Sleeping
Sleeping
Update app.py
Browse files
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]:
|
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)
|