nielsr HF staff commited on
Commit
91f9dbe
1 Parent(s): ffa5cf6

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +4 -3
README.md CHANGED
@@ -29,7 +29,7 @@ from depth_anything.dpt import DepthAnything
29
  from depth_anything.util.transform import Resize, NormalizeImage, PrepareForNet
30
  from torchvision.transforms import Compose
31
 
32
- model = DepthAnything.from_pretrained("LiheYoung/depth_anything_vits14")
33
 
34
  transform = Compose([
35
  Resize(
@@ -45,8 +45,9 @@ transform = Compose([
45
  PrepareForNet(),
46
  ])
47
 
48
- img = Image.open(...)
49
- image = transform({'image': np.array(image)})['image']
 
50
  image = torch.from_numpy(image).unsqueeze(0)
51
 
52
  depth = model(image)
 
29
  from depth_anything.util.transform import Resize, NormalizeImage, PrepareForNet
30
  from torchvision.transforms import Compose
31
 
32
+ model = DepthAnything.from_pretrained("LiheYoung/depth_anything_vitl14")
33
 
34
  transform = Compose([
35
  Resize(
 
45
  PrepareForNet(),
46
  ])
47
 
48
+ image = Image.open("...")
49
+ image = np.array(image) / 255.0
50
+ image = transform({'image': image})['image']
51
  image = torch.from_numpy(image).unsqueeze(0)
52
 
53
  depth = model(image)