snehilchatterjee commited on
Commit
13fd993
·
verified ·
1 Parent(s): c47e600

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -50,7 +50,7 @@ def model1_inf(x):
50
  model = mobilenet_v3_small(weights='DEFAULT')
51
  model.classifier[3] = nn.Linear(in_features=1024, out_features=2, bias=True)
52
 
53
- model.load_state_dict(torch.load('./method1(0.668).pt'))
54
 
55
  model.eval() # Set the model to evaluation mode
56
 
@@ -77,7 +77,7 @@ def model2_inf(x):
77
  image_np = image[0].permute(1, 2, 0).cpu().numpy()
78
  image_np = (image_np * 255).astype(np.uint8) # Ensure the image is of type uint8
79
 
80
- model.load_state_dict(torch.load('./method2(0.960).pt'))
81
  #print("\nModel weights loaded successfully")
82
 
83
  model.eval() # Set the model to evaluation mode
 
50
  model = mobilenet_v3_small(weights='DEFAULT')
51
  model.classifier[3] = nn.Linear(in_features=1024, out_features=2, bias=True)
52
 
53
+ model.load_state_dict(torch.load('./method1(0.668).pt',map_location=torch.device('cpu')))
54
 
55
  model.eval() # Set the model to evaluation mode
56
 
 
77
  image_np = image[0].permute(1, 2, 0).cpu().numpy()
78
  image_np = (image_np * 255).astype(np.uint8) # Ensure the image is of type uint8
79
 
80
+ model.load_state_dict(torch.load('./method2(0.960).pt',map_location=torch.device('cpu')))
81
  #print("\nModel weights loaded successfully")
82
 
83
  model.eval() # Set the model to evaluation mode