gberton commited on
Commit
8301d59
·
verified ·
1 Parent(s): c8f35b6

Upload README.md with huggingface_hub

Browse files
Files changed (1) hide show
  1. README.md +55 -0
README.md ADDED
@@ -0,0 +1,55 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: apache-2.0
3
+ tags:
4
+ - vision
5
+ - depth-estimation
6
+ - surface-normals
7
+ - semantic-segmentation
8
+ - dense-prediction
9
+ library_name: transformers
10
+ pipeline_tag: depth-estimation
11
+ ---
12
+
13
+ # TIPSv2 — B/14 DPT Heads
14
+
15
+ DPT (Dense Prediction Transformer) heads for depth estimation, surface normal prediction, and semantic segmentation (ADE20K, 150 classes) on top of the [TIPSv2 B/14](https://huggingface.co/google/tipsv2-b14) backbone. The backbone is loaded automatically.
16
+
17
+ ## Usage
18
+
19
+ ```bash
20
+ pip install transformers torch torchvision sentencepiece
21
+ ```
22
+
23
+ ```python
24
+ from transformers import AutoModel
25
+ from torchvision import transforms
26
+ from PIL import Image
27
+
28
+ model = AutoModel.from_pretrained("google/tipsv2-b14-dpt", trust_remote_code=True)
29
+ model.eval().cuda()
30
+
31
+ transform = transforms.Compose([transforms.Resize((448, 448)), transforms.ToTensor()])
32
+ pixel_values = transform(Image.open("photo.jpg")).unsqueeze(0).cuda()
33
+
34
+ # All tasks at once
35
+ outputs = model(pixel_values)
36
+ outputs.depth # (B, 1, H, W)
37
+ outputs.normals # (B, 3, H, W)
38
+ outputs.segmentation # (B, 150, H, W)
39
+
40
+ # Or individual tasks (only runs the requested head)
41
+ depth = model.predict_depth(pixel_values)
42
+ normals = model.predict_normals(pixel_values)
43
+ seg = model.predict_segmentation(pixel_values)
44
+ ```
45
+
46
+ ## Model details
47
+
48
+ - **Backbone**: [TIPSv2 B/14](google/tipsv2-b14) (loaded automatically)
49
+ - **Heads**: ~72M total params (depth + normals + segmentation)
50
+ - **Segmentation**: ADE20K, 150 classes
51
+ - **Input**: images in `[0, 1]` range, any resolution (multiples of 14 recommended)
52
+
53
+ ## License
54
+
55
+ Apache 2.0