OzzyGT HF staff commited on
Commit
42a1844
1 Parent(s): dc9073a

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +6 -12
README.md CHANGED
@@ -159,19 +159,13 @@ blurred_image = gaussian_blur(img)
159
  #### Depth
160
 
161
  ```python
162
- # install depthfm from https://github.com/CompVis/depth-fm
163
- import torchvision.transforms as transforms
164
- from depthfm.dfm import DepthFM
165
- depthfm_model = DepthFM(ckpt_path=checkpoint_path)
166
- depthfm_model.eval()
167
 
168
- # assuming img is a PIL image
169
- img = F.to_tensor(img)
170
- c, h, w = img.shape
171
- img = F.interpolate(img, (512, 512), mode='bilinear', align_corners=False)
172
- with torch.no_grad():
173
- img = self.depthfm_model(img, num_steps=2, ensemble_size=4)
174
- img = F.interpolate(img, (h, w), mode='bilinear', align_corners=False)
175
  ```
176
 
177
  ### Tips
 
159
  #### Depth
160
 
161
  ```python
162
+ # install image_gen_aux with: pip install git+https://github.com/asomoza/image_gen_aux.git
163
+ from image_gen_aux import DepthPreprocessor
 
 
 
164
 
165
+ image = load_image("path to image")
166
+
167
+ depth_preprocessor = DepthPreprocessor.from_pretrained("depth-anything/Depth-Anything-V2-Large-hf").to("cuda")
168
+ depth_image = depth_preprocessor(image, invert=True)[0].convert("RGB")
 
 
 
169
  ```
170
 
171
  ### Tips