wangjin2000 commited on
Commit
80511dd
·
verified ·
1 Parent(s): 9668b42

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -0
app.py CHANGED
@@ -53,6 +53,7 @@ def preprocess_image(image):
53
  #img0 = cv2.imread(image_path)
54
  img0 = letterbox(image, 640, stride=32, auto=True)[0] # Resize and pad to 640x640
55
  img = letterbox(img0, 640, stride=32, auto=True)[0] # Resize and pad to 640x640
 
56
  img = img.transpose(2, 0, 1)[::-1] # Convert BGR to RGB, to 3x416x416
57
  img = np.ascontiguousarray(img)
58
  img = torch.from_numpy(img).to(device)
 
53
  #img0 = cv2.imread(image_path)
54
  img0 = letterbox(image, 640, stride=32, auto=True)[0] # Resize and pad to 640x640
55
  img = letterbox(img0, 640, stride=32, auto=True)[0] # Resize and pad to 640x640
56
+ print("in preprocess:",img.shape)
57
  img = img.transpose(2, 0, 1)[::-1] # Convert BGR to RGB, to 3x416x416
58
  img = np.ascontiguousarray(img)
59
  img = torch.from_numpy(img).to(device)