jerilseb commited on
Commit
8b6aa34
1 Parent(s): 9a4023b

update stuff

Browse files
Files changed (1) hide show
  1. app.py +3 -6
app.py CHANGED
@@ -39,16 +39,13 @@ transform = transforms.Compose([
39
 
40
  def predict(image):
41
  image = image['composite']
42
- image = transform(image)
43
- print(image)
44
-
45
- x = torch.tensor(im, dtype=torch.float32).unsqueeze(0).unsqueeze(0) / 255.
46
 
47
  with torch.no_grad():
48
- out = model(x)
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)}