Spaces:
Runtime error
Runtime error
test
Browse files
app.py
CHANGED
|
@@ -35,9 +35,10 @@ def predict_fn(img):
|
|
| 35 |
temp = model.predict(x)
|
| 36 |
|
| 37 |
idx = np.argsort(np.squeeze(temp))[::-1]
|
| 38 |
-
|
| 39 |
-
|
| 40 |
|
| 41 |
-
return {
|
|
|
|
| 42 |
|
| 43 |
gr.Interface(predict_fn, gr.Image(type='pil'), outputs='label', examples=path,).launch()
|
|
|
|
| 35 |
temp = model.predict(x)
|
| 36 |
|
| 37 |
idx = np.argsort(np.squeeze(temp))[::-1]
|
| 38 |
+
sorted_labels = [LABELS[i] for i in idx]
|
| 39 |
+
sorted_values = [temp[0][i] for i in idx]
|
| 40 |
|
| 41 |
+
return {label: str(value) for label, value in zip(sorted_labels, sorted_values)}
|
| 42 |
+
|
| 43 |
|
| 44 |
gr.Interface(predict_fn, gr.Image(type='pil'), outputs='label', examples=path,).launch()
|