keysun89 commited on
Commit
7298238
·
verified ·
1 Parent(s): b8cd9cb

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -18,7 +18,7 @@ model.load_state_dict(torch.load(weights_path, map_location="cpu"))
18
  model.eval()
19
 
20
  # Preprocessing: same as training
21
- IMG_HEIGHT, IMG_WIDTH = 128, 128
22
  transform = transforms.Compose([
23
  transforms.Resize((IMG_HEIGHT, IMG_WIDTH)),
24
  transforms.ToTensor()
@@ -26,7 +26,7 @@ transform = transforms.Compose([
26
 
27
  def predict(image):
28
  orig_w, orig_h = image.size # original size of uploaded image
29
- img = transform(image).unsqueeze(0) # (1,3,128,128)
30
  with torch.no_grad():
31
  pred = model(img)
32
 
 
18
  model.eval()
19
 
20
  # Preprocessing: same as training
21
+ IMG_HEIGHT, IMG_WIDTH = 448, 448
22
  transform = transforms.Compose([
23
  transforms.Resize((IMG_HEIGHT, IMG_WIDTH)),
24
  transforms.ToTensor()
 
26
 
27
  def predict(image):
28
  orig_w, orig_h = image.size # original size of uploaded image
29
+ img = transform(image).unsqueeze(0)
30
  with torch.no_grad():
31
  pred = model(img)
32