umuthopeyildirim commited on
Commit
036ba1a
1 Parent(s): 3fb6608

Refactor image processing in app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -2
app.py CHANGED
@@ -79,10 +79,9 @@ with gr.Blocks(css=css) as demo:
79
  # image = torch.from_numpy(image).unsqueeze(0).to(DEVICE)
80
 
81
  image = torch.from_numpy(image.transpose((2, 0, 1))).to(DEVICE)
82
- image = torch.from_numpy(image.transpose((2, 0, 1)))
83
  image = Normalize(mean=[0.485, 0.456, 0.406], std=[
84
  0.229, 0.224, 0.225])(image)
85
- image = torch.autograd.Variable(image.unsqueeze(0).cuda())
86
 
87
  depth = predict_depth(model, image)
88
  depth = F.interpolate(depth[None], (h, w),
 
79
  # image = torch.from_numpy(image).unsqueeze(0).to(DEVICE)
80
 
81
  image = torch.from_numpy(image.transpose((2, 0, 1))).to(DEVICE)
 
82
  image = Normalize(mean=[0.485, 0.456, 0.406], std=[
83
  0.229, 0.224, 0.225])(image)
84
+ image = torch.autograd.Variable(image.unsqueeze(0).to(DEVICE))
85
 
86
  depth = predict_depth(model, image)
87
  depth = F.interpolate(depth[None], (h, w),