umuthopeyildirim
commited on
Commit
•
bd2c8ae
1
Parent(s):
036ba1a
Refactor image preprocessing in app.py
Browse files
app.py
CHANGED
@@ -81,7 +81,7 @@ with gr.Blocks(css=css) as demo:
|
|
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.
|
85 |
|
86 |
depth = predict_depth(model, image)
|
87 |
depth = F.interpolate(depth[None], (h, w),
|
|
|
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.from_numpy(image).unsqueeze(0).to(DEVICE)
|
85 |
|
86 |
depth = predict_depth(model, image)
|
87 |
depth = F.interpolate(depth[None], (h, w),
|