Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -77,7 +77,7 @@ def predict_2(image):
|
|
| 77 |
|
| 78 |
unpatched_prediction = unpatchify(patched_prediction, (image.shape[0], image.shape[1]))
|
| 79 |
labels = LABEL_NAMES
|
| 80 |
-
res = np.bincount(unpatched_prediction)/unpatched_prediction.shape[0]
|
| 81 |
out = dict(list(zip(labels, res)))
|
| 82 |
unpatched_prediction = targets_classes_colors[unpatched_prediction]
|
| 83 |
|
|
|
|
| 77 |
|
| 78 |
unpatched_prediction = unpatchify(patched_prediction, (image.shape[0], image.shape[1]))
|
| 79 |
labels = LABEL_NAMES
|
| 80 |
+
res = np.bincount(unpatched_prediction.reshape(-1))/unpatched_prediction.reshape(-1).shape[0]
|
| 81 |
out = dict(list(zip(labels, res)))
|
| 82 |
unpatched_prediction = targets_classes_colors[unpatched_prediction]
|
| 83 |
|