Spaces:
Runtime error
Runtime error
Adding examples
Browse files- app.py +5 -1
- apples.jpeg +0 -0
- banana.jpeg +0 -0
- car.jpeg +0 -0
app.py
CHANGED
|
@@ -24,10 +24,14 @@ def postprocess(prediction):
|
|
| 24 |
def predict_fn(image):
|
| 25 |
image = preprocess(image)
|
| 26 |
prediction = model(image)[0].numpy()
|
|
|
|
|
|
|
|
|
|
| 27 |
scores = postprocess(prediction)
|
| 28 |
return scores
|
| 29 |
|
| 30 |
iface = gr.Interface(fn=predict_fn,
|
| 31 |
inputs=gr.Image(shape=(224, 224)),
|
| 32 |
-
outputs=gr.Label(num_top_classes=5)
|
|
|
|
| 33 |
iface.launch()
|
|
|
|
| 24 |
def predict_fn(image):
|
| 25 |
image = preprocess(image)
|
| 26 |
prediction = model(image)[0].numpy()
|
| 27 |
+
print(model(image))
|
| 28 |
+
print(model(image).numpy())
|
| 29 |
+
print(prediction)
|
| 30 |
scores = postprocess(prediction)
|
| 31 |
return scores
|
| 32 |
|
| 33 |
iface = gr.Interface(fn=predict_fn,
|
| 34 |
inputs=gr.Image(shape=(224, 224)),
|
| 35 |
+
outputs=gr.Label(num_top_classes=5),
|
| 36 |
+
examples=["apples.jpeg", "banana.jpeg", "car.jpeg"])
|
| 37 |
iface.launch()
|
apples.jpeg
ADDED
|
banana.jpeg
ADDED
|
car.jpeg
ADDED
|