Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -17,7 +17,8 @@ def classify_image(image):
|
|
| 17 |
predictions = model.predict(img_array)
|
| 18 |
predicted_class = class_names[np.argmax(predictions[0])]
|
| 19 |
confidence = np.max(predictions[0])
|
| 20 |
-
return predicted_class
|
|
|
|
| 21 |
|
| 22 |
image_input = gr.Image() # Entferne den `shape` Parameter
|
| 23 |
label = gr.Label(num_top_classes=3)
|
|
|
|
| 17 |
predictions = model.predict(img_array)
|
| 18 |
predicted_class = class_names[np.argmax(predictions[0])]
|
| 19 |
confidence = np.max(predictions[0])
|
| 20 |
+
return {predicted_class: float(confidence)}
|
| 21 |
+
|
| 22 |
|
| 23 |
image_input = gr.Image() # Entferne den `shape` Parameter
|
| 24 |
label = gr.Label(num_top_classes=3)
|