unify implementations
Browse files
app.py
CHANGED
|
@@ -138,9 +138,8 @@ def run_classifier(image, threshold):
|
|
| 138 |
|
| 139 |
with torch.no_grad():
|
| 140 |
logits = model(tensor)
|
| 141 |
-
|
| 142 |
-
indices =
|
| 143 |
-
values = probabilities[indices]
|
| 144 |
|
| 145 |
tag_score = dict()
|
| 146 |
for i in range(indices.size(0)):
|
|
|
|
| 138 |
|
| 139 |
with torch.no_grad():
|
| 140 |
logits = model(tensor)
|
| 141 |
+
probits = torch.nn.functional.sigmoid(logits[0])
|
| 142 |
+
values, indices = probits.topk(250)
|
|
|
|
| 143 |
|
| 144 |
tag_score = dict()
|
| 145 |
for i in range(indices.size(0)):
|