Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -32,7 +32,8 @@ def predict(image):
|
|
32 |
prediction = model.predict(image) # Predict
|
33 |
predicted_class = np.argmax(prediction, axis=-1)[0] # Get the predicted class
|
34 |
class_confidence = np.max(prediction, axis=-1)[0] # Get the confidence score
|
35 |
-
return {"prediction": int(predicted_class), "confidence": class_confidence}
|
|
|
36 |
|
37 |
# Create a Gradio interface
|
38 |
interface = gr.Interface(fn=predict, inputs="image", outputs="json")
|
|
|
32 |
prediction = model.predict(image) # Predict
|
33 |
predicted_class = np.argmax(prediction, axis=-1)[0] # Get the predicted class
|
34 |
class_confidence = np.max(prediction, axis=-1)[0] # Get the confidence score
|
35 |
+
#return {"prediction": int(predicted_class), "confidence": class_confidence}
|
36 |
+
return {"prediction": int(predicted_class)}
|
37 |
|
38 |
# Create a Gradio interface
|
39 |
interface = gr.Interface(fn=predict, inputs="image", outputs="json")
|