Spaces:
Sleeping
Sleeping
update stuff
Browse files
app.py
CHANGED
@@ -39,16 +39,13 @@ transform = transforms.Compose([
|
|
39 |
|
40 |
def predict(image):
|
41 |
image = image['composite']
|
42 |
-
|
43 |
-
print(
|
44 |
-
|
45 |
-
x = torch.tensor(im, dtype=torch.float32).unsqueeze(0).unsqueeze(0) / 255.
|
46 |
|
47 |
with torch.no_grad():
|
48 |
-
out = model(
|
49 |
|
50 |
probabilities = F.softmax(out[0], dim=0)
|
51 |
-
|
52 |
values, indices = torch.topk(probabilities, 5)
|
53 |
|
54 |
return {LABELS[i]: v.item() for i, v in zip(indices, values)}
|
|
|
39 |
|
40 |
def predict(image):
|
41 |
image = image['composite']
|
42 |
+
input = transform(image)
|
43 |
+
print(input)
|
|
|
|
|
44 |
|
45 |
with torch.no_grad():
|
46 |
+
out = model(input)
|
47 |
|
48 |
probabilities = F.softmax(out[0], dim=0)
|
|
|
49 |
values, indices = torch.topk(probabilities, 5)
|
50 |
|
51 |
return {LABELS[i]: v.item() for i, v in zip(indices, values)}
|