Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -87,7 +87,9 @@ def predict(image: PIL.Image.Image, score_threshold: float,
|
|
| 87 |
if prob < score_threshold:
|
| 88 |
continue
|
| 89 |
res[label] = prob
|
| 90 |
-
|
|
|
|
|
|
|
| 91 |
|
| 92 |
|
| 93 |
def main():
|
|
|
|
| 87 |
if prob < score_threshold:
|
| 88 |
continue
|
| 89 |
res[label] = prob
|
| 90 |
+
b = dict(sorted(res.items(),key=lambda item:item[1], reverse=True))
|
| 91 |
+
a = ', '.join(list(b.keys())).replace('_',' ')
|
| 92 |
+
return a
|
| 93 |
|
| 94 |
|
| 95 |
def main():
|