Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -45,13 +45,12 @@ with gr.Blocks() as demo:
|
|
| 45 |
print "Test accuracy: ", test_acc
|
| 46 |
|
| 47 |
# Define any necessary preprocessing steps for the image input here
|
| 48 |
-
probability_model = tf.keras.Sequential([model,
|
| 49 |
-
tf.keras.layers.Softmax()])
|
| 50 |
# Make a prediction using the model
|
| 51 |
prediction = probability_model.predict(img)
|
| 52 |
|
| 53 |
# Postprocess the prediction and return it
|
| 54 |
-
return
|
| 55 |
|
| 56 |
|
| 57 |
# Creates the Gradio interface objects
|
|
|
|
| 45 |
print "Test accuracy: ", test_acc
|
| 46 |
|
| 47 |
# Define any necessary preprocessing steps for the image input here
|
| 48 |
+
probability_model = tf.keras.Sequential([model, tf.keras.layers.Softmax()])
|
|
|
|
| 49 |
# Make a prediction using the model
|
| 50 |
prediction = probability_model.predict(img)
|
| 51 |
|
| 52 |
# Postprocess the prediction and return it
|
| 53 |
+
return np.argmax(predictions[0])
|
| 54 |
|
| 55 |
|
| 56 |
# Creates the Gradio interface objects
|