EmanHassan26 commited on
Commit
c79550e
·
verified ·
1 Parent(s): 951f374

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -37,7 +37,7 @@ pipe_depth = StableDiffusionControlNetPipeline.from_pretrained(
37
 
38
  # Load a quick, highly accurate MiDaS model pipeline via torch hub
39
  midas = torch.hub.load("intel-isl/MiDaS", "MiDaS_small").to(device).eval()
40
- midas_transforms = torch.hub.load("intel-isl/MiDaS", "transforms")
41
 
42
 
43
  @spaces.GPU
@@ -121,6 +121,7 @@ def extract_depth_map(image_path):
121
  Utilizes a lightweight MiDaS pipeline to extract depth estimation layouts.
122
  """
123
  transform_depth = midas_transforms.flag_transform if hasattr(midas_transforms, 'flag_transform') else midas_transforms.dpt_transform
 
124
 
125
  pil_image = Image.open(image_path).convert("RGB")
126
  cv_img = np.array(pil_image)
 
37
 
38
  # Load a quick, highly accurate MiDaS model pipeline via torch hub
39
  midas = torch.hub.load("intel-isl/MiDaS", "MiDaS_small").to(device).eval()
40
+
41
 
42
 
43
  @spaces.GPU
 
121
  Utilizes a lightweight MiDaS pipeline to extract depth estimation layouts.
122
  """
123
  transform_depth = midas_transforms.flag_transform if hasattr(midas_transforms, 'flag_transform') else midas_transforms.dpt_transform
124
+ midas_transforms = torch.hub.load("intel-isl/MiDaS", "transforms")
125
 
126
  pil_image = Image.open(image_path).convert("RGB")
127
  cv_img = np.array(pil_image)