Update app.py
Browse files
app.py
CHANGED
|
@@ -195,7 +195,7 @@ with tempfile.TemporaryDirectory() as tmpdir:
|
|
| 195 |
|
| 196 |
dam2 = get_dam2_model()
|
| 197 |
depth_dam2 = dam2.infer_image(image_bgr)
|
| 198 |
-
depth = torch.tensor(depth_dam2).unsqueeze(0).unsqueeze(0).float()
|
| 199 |
|
| 200 |
depth_image = cv2.applyColorMap((normalize_disp(depth_dam2) * 255).astype(np.uint8), cv2.COLORMAP_JET)
|
| 201 |
|
|
@@ -203,7 +203,7 @@ with tempfile.TemporaryDirectory() as tmpdir:
|
|
| 203 |
|
| 204 |
@spaces.GPU()
|
| 205 |
def cb_generate(image, depth: Tensor, scale_factor):
|
| 206 |
-
norm_disp = normalize_disp(depth)
|
| 207 |
disp = norm_disp * scale_factor / 100 * IMAGE_SIZE
|
| 208 |
|
| 209 |
genstereo = get_genstereo_model()
|
|
|
|
| 195 |
|
| 196 |
dam2 = get_dam2_model()
|
| 197 |
depth_dam2 = dam2.infer_image(image_bgr)
|
| 198 |
+
depth = torch.tensor(depth_dam2).unsqueeze(0).unsqueeze(0).float()
|
| 199 |
|
| 200 |
depth_image = cv2.applyColorMap((normalize_disp(depth_dam2) * 255).astype(np.uint8), cv2.COLORMAP_JET)
|
| 201 |
|
|
|
|
| 203 |
|
| 204 |
@spaces.GPU()
|
| 205 |
def cb_generate(image, depth: Tensor, scale_factor):
|
| 206 |
+
norm_disp = normalize_disp(depth.cuda())
|
| 207 |
disp = norm_disp * scale_factor / 100 * IMAGE_SIZE
|
| 208 |
|
| 209 |
genstereo = get_genstereo_model()
|