bhardwaj08sarthak commited on
Commit
6cf1895
·
verified ·
1 Parent(s): 361c179

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -12,12 +12,12 @@ model.load_state_dict(state_dict)
12
  model.eval()
13
 
14
  #predictions
15
- imgTransforms = transforms.Compose([transforms.Resize(256), transforms.CenterCrop(224), trasforms.ToTensor(),transforms.Normalize([0.485,0.456,0.406],[0.229,0.224,0.225])])
16
 
17
  LABELS =['Fiat 500', 'VW Up']
18
  def predict(inp):
19
  inp= Image.fromarray(inp.astype('unit8'), 'RGB')
20
- inp =imgTransfroms(inp).unsqueeze(0)
21
 
22
  with torch.no_grad():
23
  predictions = torch.nn.functional.softmax(model(inp)[0])
 
12
  model.eval()
13
 
14
  #predictions
15
+ imgTransforms = transforms.Compose([transforms.Resize(256), transforms.CenterCrop(224), transforms.ToTensor(),transforms.Normalize([0.485,0.456,0.406],[0.229,0.224,0.225])])
16
 
17
  LABELS =['Fiat 500', 'VW Up']
18
  def predict(inp):
19
  inp= Image.fromarray(inp.astype('unit8'), 'RGB')
20
+ inp =imgTransforms(inp).unsqueeze(0)
21
 
22
  with torch.no_grad():
23
  predictions = torch.nn.functional.softmax(model(inp)[0])