EgoHackZero commited on
Commit
5af96f6
·
1 Parent(s): e132a83

solve problem with input

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -14,10 +14,10 @@ transform = midas_transforms.small_transform
14
  def predict_depth(image):
15
  img = np.array(image)
16
  img_rgb = cv2.cvtColor(img, cv2.COLOR_BGR2RGB)
17
- input_tensor = transform(img_rgb).unsqueeze(0)
18
 
19
  with torch.no_grad():
20
- prediction = midas(input_tensor)
21
  prediction = torch.nn.functional.interpolate(
22
  prediction.unsqueeze(1),
23
  size=img_rgb.shape[:2],
 
14
  def predict_depth(image):
15
  img = np.array(image)
16
  img_rgb = cv2.cvtColor(img, cv2.COLOR_BGR2RGB)
17
+ input_tensor = transform(img_rgb)
18
 
19
  with torch.no_grad():
20
+ prediction = midas(input_tensor.unsqueeze(0))
21
  prediction = torch.nn.functional.interpolate(
22
  prediction.unsqueeze(1),
23
  size=img_rgb.shape[:2],