Datasets:
Update README.md
Browse files
README.md
CHANGED
|
@@ -1,272 +1,98 @@
|
|
| 1 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2 |
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
## Model Details
|
| 13 |
-
The model takes an image as input and returns a class token and patch tokens, and optionally 4 register tokens.
|
| 14 |
-
|
| 15 |
-
The embedding dimension is:
|
| 16 |
-
- 384 for ViT-S.
|
| 17 |
-
- 768 for ViT-B.
|
| 18 |
-
- 1024 for ViT-L.
|
| 19 |
-
- 1536 for ViT-g.
|
| 20 |
-
|
| 21 |
-
The models follow a Transformer architecture, with a patch size of 14. In the case of registers, we add 4 register tokens, learned during training, to the input sequence after the patch embedding.
|
| 22 |
-
|
| 23 |
-
For a 224x224 image, this results in 1 class token + 256 patch tokens, and optionally 4 register tokens.
|
| 24 |
-
|
| 25 |
-
The models can accept larger images provided the image shapes are multiples of the patch size (14).
|
| 26 |
-
If this condition is not verified, the model will crop to the closest smaller multiple of the patch size.
|
| 27 |
-
|
| 28 |
-
### Model Description
|
| 29 |
-
|
| 30 |
-
- **Developed by:** Meta AI
|
| 31 |
-
- **Model type:** Vision Transformer
|
| 32 |
-
- **License:** Apache License 2.0
|
| 33 |
-
|
| 34 |
-
- **Repository:** https://github.com/facebookresearch/dinov2
|
| 35 |
-
- **Paper:** https://arxiv.org/abs/2304.07193
|
| 36 |
-
- **Demo:** https://dinov2.metademolab.com/
|
| 37 |
-
|
| 38 |
-
## Uses
|
| 39 |
-
|
| 40 |
-
The models are vision backbones providing multi-purpose features for downstream tasks.
|
| 41 |
-
|
| 42 |
-
### Direct Use
|
| 43 |
-
|
| 44 |
-
The models can be used without fine-tuning, with downstream classifiers as simple as linear layers, to obtain competitive results:
|
| 45 |
-
- on depth estimation, semantic segmentation, using linear layers.
|
| 46 |
-
- on image classification, using k-NN classifiers on the class token.
|
| 47 |
-
- on image classification, with logistic regression classifiers applied on the class token.
|
| 48 |
-
- on image classification, with a linear layer applied on the class token and the average of the patch tokens.
|
| 49 |
-
- on image retrieval using nearest neighbors.
|
| 50 |
-
|
| 51 |
-
### Downstream Use
|
| 52 |
-
|
| 53 |
-
It is technically possible to perform fine-tuning on the models, for small gains (we measured +2% on ImageNet-1k classification).
|
| 54 |
-
We recommend keeping this as a very last step and only when necessary, as the features already provide good performance out-of-the-box.
|
| 55 |
-
|
| 56 |
-
## Bias, Risks, and Limitations
|
| 57 |
-
|
| 58 |
-
Despite improvements thanks to the training method not using annotations, we still observe significant biases in our models toward rich households from Western countries.
|
| 59 |
-
|
| 60 |
-
### Recommendations
|
| 61 |
-
|
| 62 |
-
We expect fine-tuning will increase the biases in the features produced by the model as they will be tuned to the fine-tuning labels.
|
| 63 |
-
|
| 64 |
-
## How to Get Started with the Model
|
| 65 |
-
|
| 66 |
-
Use the code below to get started with the model.
|
| 67 |
-
|
| 68 |
-
```python
|
| 69 |
-
import torch
|
| 70 |
-
|
| 71 |
-
# DINOv2
|
| 72 |
-
dinov2_vits14 = torch.hub.load('facebookresearch/dinov2', 'dinov2_vits14')
|
| 73 |
-
dinov2_vitb14 = torch.hub.load('facebookresearch/dinov2', 'dinov2_vitb14')
|
| 74 |
-
dinov2_vitl14 = torch.hub.load('facebookresearch/dinov2', 'dinov2_vitl14')
|
| 75 |
-
dinov2_vitg14 = torch.hub.load('facebookresearch/dinov2', 'dinov2_vitg14')
|
| 76 |
-
|
| 77 |
-
# DINOv2 with registers
|
| 78 |
-
dinov2_vits14_reg = torch.hub.load('facebookresearch/dinov2', 'dinov2_vits14_reg')
|
| 79 |
-
dinov2_vitb14_reg = torch.hub.load('facebookresearch/dinov2', 'dinov2_vitb14_reg')
|
| 80 |
-
dinov2_vitl14_reg = torch.hub.load('facebookresearch/dinov2', 'dinov2_vitl14_reg')
|
| 81 |
-
dinov2_vitg14_reg = torch.hub.load('facebookresearch/dinov2', 'dinov2_vitg14_reg')
|
| 82 |
```
|
| 83 |
|
| 84 |
-
|
|
|
|
| 85 |
|
| 86 |
-
###
|
| 87 |
|
| 88 |
-
|
| 89 |
-
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 90 |
|
| 91 |
-
##
|
| 92 |
|
| 93 |
-
|
| 94 |
-
- DINO self-distillation loss with multi-crop
|
| 95 |
-
- iBOT masked-image modeling loss
|
| 96 |
-
- KoLeo regularization on [CLS] tokens
|
| 97 |
-
- **Architectures:**
|
| 98 |
-
- ViT-S (21M params): Patch size 14, embedding dimension 384, 6 heads, MLP FFN
|
| 99 |
-
- ViT-B (86M params): Patch size 14, embedding dimension 768, 12 heads, MLP FFN
|
| 100 |
-
- ViT-L (0.3B params): Patch size 14, embedding dimension 1024, 16 heads, MLP FFN
|
| 101 |
-
- ViT-g (1.1B params): Patch size 14, embedding dimension 1536, 24 heads, SwiGLU FFN
|
| 102 |
-
- **Distillation:**
|
| 103 |
-
- Distillation follows the standard DINOv2 pretraining procedure, except the teacher is a pretrained ViT-g, frozen.
|
| 104 |
|
| 105 |
-
|
|
|
|
|
|
|
| 106 |
|
| 107 |
-
|
| 108 |
|
| 109 |
-
|
| 110 |
-
|
| 111 |
-
|
| 112 |
-
<th colspan="3">ImageNet-1k</th>
|
| 113 |
-
<th>NYU-Depth v2</th>
|
| 114 |
-
<th>SUN-RGBD</th>
|
| 115 |
-
<th>ADE20k</th>
|
| 116 |
-
<th>iNaturalist 2018</th>
|
| 117 |
-
<th>Oxford-H</th>
|
| 118 |
-
</tr>
|
| 119 |
-
<tr>
|
| 120 |
-
<th rowspan="2">model</th>
|
| 121 |
-
<th rowspan="2">with <br /> registers</th>
|
| 122 |
-
<th>classif. (acc)</th>
|
| 123 |
-
<th>classif. (acc)</th>
|
| 124 |
-
<th>classif. V2 (acc)</th>
|
| 125 |
-
<th>depth (RMSE)</th>
|
| 126 |
-
<th>depth (RMSE)</th>
|
| 127 |
-
<th>segm. (mAP)</th>
|
| 128 |
-
<th>classif. (acc)</th>
|
| 129 |
-
<th>retrieval (mAP)</th>
|
| 130 |
-
</tr>
|
| 131 |
-
<tr>
|
| 132 |
-
<!-- <th>^</th> -->
|
| 133 |
-
<th>k-NN</th>
|
| 134 |
-
<th>linear</th>
|
| 135 |
-
<th>linear</th>
|
| 136 |
-
<th>linear<br />4 layers</th>
|
| 137 |
-
<th>NYU-D transfer</th>
|
| 138 |
-
<th>multiscale</th>
|
| 139 |
-
<th>linear</th>
|
| 140 |
-
<th>nearest neighbor</th>
|
| 141 |
-
</tr>
|
| 142 |
-
<tr>
|
| 143 |
-
<td>ViT-S/14</td>
|
| 144 |
-
<td align="center">:x:</td>
|
| 145 |
-
<td align="right">79.0%</td>
|
| 146 |
-
<td align="right">81.1%</td>
|
| 147 |
-
<td align="right">70.8%</td>
|
| 148 |
-
<td align="right">0.417</td>
|
| 149 |
-
<td align="right">0.431</td>
|
| 150 |
-
<td align="right">47.2</td>
|
| 151 |
-
<td align="right">69.5%</td>
|
| 152 |
-
<td align="right">43.2</td>
|
| 153 |
-
</tr>
|
| 154 |
-
<tr>
|
| 155 |
-
<td>ViT-S/14</td>
|
| 156 |
-
<td align="center">:white_check_mark:</td>
|
| 157 |
-
<td align="right">79.1%</td>
|
| 158 |
-
<td align="right">80.9%</td>
|
| 159 |
-
<td align="right">71.0%</td>
|
| 160 |
-
<td align="right">N/A</td>
|
| 161 |
-
<td align="right">N/A</td>
|
| 162 |
-
<td align="right">N/A</td>
|
| 163 |
-
<td align="right">67.6%</td>
|
| 164 |
-
<td align="right">39.5</td>
|
| 165 |
-
</tr>
|
| 166 |
-
<tr>
|
| 167 |
-
<td>ViT-B/14</td>
|
| 168 |
-
<td align="center">:x:</td>
|
| 169 |
-
<td align="right">82.1%</td>
|
| 170 |
-
<td align="right">84.5%</td>
|
| 171 |
-
<td align="right">74.9%</td>
|
| 172 |
-
<td align="right">0.362</td>
|
| 173 |
-
<td align="right">0.400</td>
|
| 174 |
-
<td align="right">51.3</td>
|
| 175 |
-
<td align="right">76.3%</td>
|
| 176 |
-
<td align="right">49.5</td>
|
| 177 |
-
</tr>
|
| 178 |
-
<td>ViT-B/14</td>
|
| 179 |
-
<td align="center">:white_check_mark:</td>
|
| 180 |
-
<td align="right">82.0%</td>
|
| 181 |
-
<td align="right">84.6%</td>
|
| 182 |
-
<td align="right">75.6%</td>
|
| 183 |
-
<td align="right">N/A</td>
|
| 184 |
-
<td align="right">N/A</td>
|
| 185 |
-
<td align="right">N/A</td>
|
| 186 |
-
<td align="right">73.8%</td>
|
| 187 |
-
<td align="right">51.0</td>
|
| 188 |
-
</tr>
|
| 189 |
-
<tr>
|
| 190 |
-
<td>ViT-L/14</td>
|
| 191 |
-
<td align="center">:x:</td>
|
| 192 |
-
<td align="right">83.5%</td>
|
| 193 |
-
<td align="right">86.3%</td>
|
| 194 |
-
<td align="right">77.6%</td>
|
| 195 |
-
<td align="right">0.333</td>
|
| 196 |
-
<td align="right">0.396</td>
|
| 197 |
-
<td align="right">53.1</td>
|
| 198 |
-
<td align="right">79.8%</td>
|
| 199 |
-
<td align="right">54.0</td>
|
| 200 |
-
</tr>
|
| 201 |
-
<tr>
|
| 202 |
-
<td>ViT-L/14</td>
|
| 203 |
-
<td align="center">:white_check_mark:</td>
|
| 204 |
-
<td align="right">83.8%</td>
|
| 205 |
-
<td align="right">86.7%</td>
|
| 206 |
-
<td align="right">78.5%</td>
|
| 207 |
-
<td align="right">N/A</td>
|
| 208 |
-
<td align="right">N/A</td>
|
| 209 |
-
<td align="right">N/A</td>
|
| 210 |
-
<td align="right">80.9%</td>
|
| 211 |
-
<td align="right">55.7</td>
|
| 212 |
-
</tr>
|
| 213 |
-
<tr>
|
| 214 |
-
<td>ViT-g/14</td>
|
| 215 |
-
<td align="center">:x:</td>
|
| 216 |
-
<td align="right">83.5%</td>
|
| 217 |
-
<td align="right">86.5%</td>
|
| 218 |
-
<td align="right">78.4%</td>
|
| 219 |
-
<td align="right">0.298</td>
|
| 220 |
-
<td align="right">0.362</td>
|
| 221 |
-
<td align="right">53.0</td>
|
| 222 |
-
<td align="right">81.6%</td>
|
| 223 |
-
<td align="right">52.3</td>
|
| 224 |
-
</tr>
|
| 225 |
-
<tr>
|
| 226 |
-
<tr>
|
| 227 |
-
<td>ViT-g/14</td>
|
| 228 |
-
<td align="center">:white_check_mark:</td>
|
| 229 |
-
<td align="right">83.7%</td>
|
| 230 |
-
<td align="right">87.1%</td>
|
| 231 |
-
<td align="right">78.8%</td>
|
| 232 |
-
<td align="right">N/A</td>
|
| 233 |
-
<td align="right">N/A</td>
|
| 234 |
-
<td align="right">N/A</td>
|
| 235 |
-
<td align="right">81.5%</td>
|
| 236 |
-
<td align="right">58.2</td>
|
| 237 |
-
</tr>
|
| 238 |
-
</table>
|
| 239 |
|
| 240 |
-
##
|
| 241 |
|
| 242 |
-
|
| 243 |
-
- **Hours used:** 22,000 for ViT-g, 4,500 for ViT-S distillation, 5,300 for ViT-B distillation, 8,000 for ViT-L distillation
|
| 244 |
-
- **Cloud Provider:** Private infra
|
| 245 |
-
- **Compute Region:** USA
|
| 246 |
-
- **Carbon Emitted:** 7t CO2eq
|
| 247 |
|
| 248 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 249 |
|
| 250 |
-
|
| 251 |
|
| 252 |
-
#### Software
|
| 253 |
|
| 254 |
-
|
| 255 |
-
xFormers 0.0.18
|
| 256 |
|
| 257 |
-
|
| 258 |
|
| 259 |
-
```
|
| 260 |
-
@
|
| 261 |
-
title={
|
| 262 |
-
author={
|
| 263 |
-
journal={
|
| 264 |
-
year={
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 265 |
}
|
| 266 |
-
@
|
| 267 |
-
title={
|
| 268 |
-
author={
|
| 269 |
-
|
| 270 |
-
year={
|
| 271 |
}
|
| 272 |
```
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: cc-by-nc-4.0
|
| 3 |
+
task_categories:
|
| 4 |
+
- depth-estimation
|
| 5 |
+
tags:
|
| 6 |
+
- stereo-matching
|
| 7 |
+
- disparity
|
| 8 |
+
- stereo4d
|
| 9 |
+
- foundationstereo
|
| 10 |
+
pretty_name: FFS Stereo4D
|
| 11 |
+
size_categories:
|
| 12 |
+
- 100K<n<1M
|
| 13 |
+
---
|
| 14 |
+
|
| 15 |
+
# FFS Stereo4D
|
| 16 |
+
|
| 17 |
+
Disparity maps for stereo matching, generated from the [Stereo4D](https://github.com/niconielsen32/Stereo4D) dataset using [FoundationStereo](https://github.com/NVlabs/FoundationStereo).
|
| 18 |
+
|
| 19 |
+
## Dataset Structure
|
| 20 |
|
| 21 |
+
```
|
| 22 |
+
data/train/
|
| 23 |
+
metadata.csv
|
| 24 |
+
disparity/
|
| 25 |
+
0000000/
|
| 26 |
+
{vid_id}_frame_{frame_idx:06d}.png
|
| 27 |
+
0000001/
|
| 28 |
+
...
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 29 |
```
|
| 30 |
|
| 31 |
+
- **Disparity images**: 16-bit 784×784 PNG files storing per-pixel disparity values. You can read by following: https://github.com/NVlabs/FoundationStereo/blob/master/scripts/vis_dataset.py
|
| 32 |
+
- **metadata.csv**: Links each disparity image back to its source YouTube video.
|
| 33 |
|
| 34 |
+
### Metadata Columns
|
| 35 |
|
| 36 |
+
| Column | Description |
|
| 37 |
+
|---|---|
|
| 38 |
+
| `file_name` | Relative path to the disparity image |
|
| 39 |
+
| `vid_id` | Clip identifier (matches the `.npz` calibration file) |
|
| 40 |
+
| `frame_idx` | Frame index in the rectified stereo output |
|
| 41 |
+
| `youtube_video_id` | YouTube video ID of the source 360 video |
|
| 42 |
+
| `timestamp_us` | Timestamp in microseconds in the original video |
|
| 43 |
+
| `timestamp_sec` | Timestamp in seconds |
|
| 44 |
+
| `video_frame_index` | Estimated frame number in the original video |
|
| 45 |
+
| `fps` | FPS of the source video |
|
| 46 |
|
| 47 |
+
## Retrieving Source RGB Frames
|
| 48 |
|
| 49 |
+
This dataset contains **disparity maps only**. Due to the copyrights of these videos, users need to download on your own behalf. The corresponding left/right RGB stereo pairs can be recovered by:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 50 |
|
| 51 |
+
1. Following [stereo4d toolkit](https://github.com/Stereo4d/stereo4d-code) to download the YouTube video using `youtube_video_id`.
|
| 52 |
+
2. Seek to `timestamp_sec` (or `video_frame_index`) to locate the source frame.
|
| 53 |
+
3. Apply equirectangular rectification using the Stereo4D calibration `.npz` files to obtain the left and right perspective images.
|
| 54 |
|
| 55 |
+
## Generation Pipeline
|
| 56 |
|
| 57 |
+
1. **Source**: YouTube 360 videos from the Stereo4D dataset.
|
| 58 |
+
2. **Rectification**: Equirectangular frames are rectified and cropped to 1024×1024 perspective stereo pairs.
|
| 59 |
+
3. **Disparity estimation**: FoundationStereo computes dense disparity at 784×784 resolution (resized by `scale=0.765625` of the 1024×1024 input).
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 60 |
|
| 61 |
+
### Camera Parameters
|
| 62 |
|
| 63 |
+
The following assumed parameters are used for depth and normal map computation:
|
|
|
|
|
|
|
|
|
|
|
|
|
| 64 |
|
| 65 |
+
| Parameter | Value | Notes |
|
| 66 |
+
|---|---|---|
|
| 67 |
+
| Baseline | 0.063 m | From Stereo4D calibration, the assumed interpupillary distance for the VR180 cameras. |
|
| 68 |
+
| HFOV | 60° | Matches `output_hfov` in rectification |
|
| 69 |
+
| fx, fy | ~678.8 px | `width / (2 * tan(HFOV/2))`, for 784×784 |
|
| 70 |
+
| cx, cy | 392 px | Image center |
|
| 71 |
|
| 72 |
+
Depth is derived as: `depth = fx * baseline / disparity`.
|
| 73 |
|
|
|
|
| 74 |
|
| 75 |
+
## Citation
|
|
|
|
| 76 |
|
| 77 |
+
If you use this dataset, please consider cite:
|
| 78 |
|
| 79 |
+
```bibtex
|
| 80 |
+
@article{wen2026fastfoundationstereo,
|
| 81 |
+
title={Fast-FoundationStereo: Real-Time Zero-Shot Stereo Matching},
|
| 82 |
+
author={Bowen Wen and Shaurya Dewan and Stan Birchfield},
|
| 83 |
+
journal={CVPR},
|
| 84 |
+
year={2026}
|
| 85 |
+
}
|
| 86 |
+
@article{wen2025foundationstereo,
|
| 87 |
+
title={FoundationStereo: Zero-Shot Stereo Matching},
|
| 88 |
+
author={Wen, Bowen and Trepte, Matthew and Aribido, Joseph and Kautz, Jan and Birchfield, Stan and Wan, Yao},
|
| 89 |
+
journal={CVPR},
|
| 90 |
+
year={2025}
|
| 91 |
}
|
| 92 |
+
@inproceedings{jin2025stereo4d,
|
| 93 |
+
title={{Stereo4D: Learning How Things Move in 3D from Internet Stereo Videos}},
|
| 94 |
+
author={Jin, Linyi and Tucker, Richard and Li, Zhengqi and Fouhey, David and Snavely, Noah and Holynski, Aleksander},
|
| 95 |
+
booktitle={Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition},
|
| 96 |
+
year={2025},
|
| 97 |
}
|
| 98 |
```
|