Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -42,10 +42,12 @@ def clf(name):
|
|
42 |
data[0] = normalized_image_array
|
43 |
|
44 |
# run the inference
|
45 |
-
prediction = model.predict(data)
|
46 |
-
|
47 |
|
48 |
-
return
|
49 |
|
50 |
-
|
51 |
-
|
|
|
|
|
|
42 |
data[0] = normalized_image_array
|
43 |
|
44 |
# run the inference
|
45 |
+
prediction = model.predict(data)
|
46 |
+
confidences = {label_dict[i]: float(prediction[i]) for i in range(4)}
|
47 |
|
48 |
+
return confidences
|
49 |
|
50 |
+
gr.Interface(fn=predict,
|
51 |
+
inputs=gr.Image(type="pil"),
|
52 |
+
outputs=gr.Label(num_top_classes=5),
|
53 |
+
examples=["12122.jpg", "12342.jpg", "23482.jpg", "23992.jpg", "29349.jpg", "29384.jpg", "32321.jpg", "43413.jpg", "59394.jpg", "77923.jpg", "83823.jpg", "88893.jpg", "88921.jpg", "88923.jpg", "92309.jpg", "92921.jpg"]).launch()
|