Gabriele commited on
Commit ·
df8dbf3
1
Parent(s): def9b0d
Add print statements with descriptive comments to code examples
Browse files
README.md
CHANGED
|
@@ -36,14 +36,15 @@ pixel_values = transform(image).unsqueeze(0).cuda()
|
|
| 36 |
|
| 37 |
# All tasks at once
|
| 38 |
outputs = model(pixel_values)
|
| 39 |
-
outputs.depth
|
| 40 |
-
outputs.normals
|
| 41 |
-
outputs.segmentation
|
| 42 |
|
| 43 |
# Or individual tasks (only runs the requested head)
|
| 44 |
depth = model.predict_depth(pixel_values)
|
| 45 |
normals = model.predict_normals(pixel_values)
|
| 46 |
seg = model.predict_segmentation(pixel_values)
|
|
|
|
| 47 |
```
|
| 48 |
|
| 49 |
## Model details
|
|
|
|
| 36 |
|
| 37 |
# All tasks at once
|
| 38 |
outputs = model(pixel_values)
|
| 39 |
+
print(outputs.depth.shape) # (1, 1, 448, 448) — depth map
|
| 40 |
+
print(outputs.normals.shape) # (1, 3, 448, 448) — surface normals
|
| 41 |
+
print(outputs.segmentation.shape) # (1, 150, 448, 448) — segmentation logits
|
| 42 |
|
| 43 |
# Or individual tasks (only runs the requested head)
|
| 44 |
depth = model.predict_depth(pixel_values)
|
| 45 |
normals = model.predict_normals(pixel_values)
|
| 46 |
seg = model.predict_segmentation(pixel_values)
|
| 47 |
+
print(seg.argmax(dim=1).shape) # (1, 448, 448) — per-pixel class prediction
|
| 48 |
```
|
| 49 |
|
| 50 |
## Model details
|