File size: 6,981 Bytes
99f2060
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
f5af192
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
99f2060
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
---
pretty_name: VisionDrive3D
license: mit
task_categories:
  - object-detection
  - image-segmentation
  - depth-estimation
tags:
  - synthetic
  - autonomous-driving
  - 3d-object-detection
  - kitti
  - coco
  - yolo
  - opengl
size_categories:
  - 1K<n<10K
---

# VisionDrive3D: Synthetic Driving Dataset

VisionDrive3D is a synthetic urban driving dataset rendered with a custom OpenGL engine.
Every scene comes with an RGB image, a dense metric depth map, a segmentation mask,
and annotations in **COCO**, **YOLO**, and **KITTI (3D)** formats. It also includes
per-scene camera parameters (intrinsics and extrinsics) and object metadata.

- **Code & project page:** https://github.com/BenBunBo/VisionDrive3D
- **File:** `VisonDrive3D_testdata.zip` (~1.1 GB compressed, ~6.6 GB extracted)

## Summary

| Property | Value |
|---|---|
| Scenes | 1,000 |
| Resolution | 1600 × 900 |
| Annotated class | `car` (2,585 instances) |
| Splits | train 800 / val 100 / test 100 |
| Modalities | RGB, depth (`float32`, metres), segmentation mask |
| Label formats | COCO JSON, YOLO TXT, KITTI 3D TXT |
| Camera | Pinhole, fx = fy = 1200, cx = 800, cy = 450, FOV 45°, near 0.1, far 150 |

## Installation

### 1. Download

**Option A: `hf` CLI (recommended)**

```bash
pip install -U huggingface_hub
hf download BenBunBo/VisionDrive3D VisonDrive3D_testdata.zip \
    --repo-type dataset --local-dir ./data
```

**Option B: Python**

```python
from huggingface_hub import hf_hub_download

zip_path = hf_hub_download(
    repo_id="BenBunBo/VisionDrive3D",
    filename="VisonDrive3D_testdata.zip",
    repo_type="dataset",
    local_dir="./data",
)
print(zip_path)
```

**Option C: Direct link / git**

```bash
wget https://huggingface.co/datasets/BenBunBo/VisionDrive3D/resolve/main/VisonDrive3D_testdata.zip
# or
git lfs install
git clone https://huggingface.co/datasets/BenBunBo/VisionDrive3D
```

### 2. Extract

The archive has no top-level folder, so extract it into its own directory:

```bash
mkdir -p data/output_dataset
unzip data/VisonDrive3D_testdata.zip -d data/output_dataset
```

```python
import zipfile
zipfile.ZipFile("data/VisonDrive3D_testdata.zip").extractall("data/output_dataset")
```

### 3. Verify

```bash
ls data/output_dataset
# depth  images  ImageSets  labels  masks  metadata  README.txt
ls data/output_dataset/images | wc -l    # 1000
wc -l data/output_dataset/ImageSets/*.txt # 800 / 100 / 100
```

### 4. Use with the VisionDrive3D code (optional)

```bash
git clone https://github.com/BenBunBo/VisionDrive3D
cd VisionDrive3D
# Put the extracted folder at ./output_dataset (the default path used by the scripts)
ln -s /path/to/data/output_dataset ./output_dataset
python src/ai_demo/run_all.py --dataset ./output_dataset
```

## Folder structure

```
output_dataset/
├── README.txt
├── images/              # RGB renders            scene_XXXXX.png  (1600×900, 8-bit RGB)
├── depth/               # Depth maps             scene_XXXXX.npy  (900×1600, float32, metres)
├── masks/               # Segmentation masks     scene_XXXXX.png  (1600×900, 8-bit RGB colour-coded)
├── labels/
│   ├── coco/            # COCO JSON              scene_XXXXX.json
│   ├── yolo/            # YOLO TXT               scene_XXXXX.txt
│   └── kitti/           # KITTI 3D TXT           scene_XXXXX.txt
├── metadata/
│   ├── scene_XXXXX.json # Camera + per-object metadata
│   └── dataset_log.csv  # One row per scene (camera position, depth range, #objects, ...)
└── ImageSets/
    ├── train.txt        # 800 scene ids
    ├── val.txt          # 100 scene ids
    └── test.txt         # 100 scene ids
```

Scenes are named `scene_00000` … `scene_00999`. Each file in `ImageSets/` lists one
5-digit id per line (e.g. `00042` → `scene_00042`).

## Annotation formats

**YOLO** (`labels/yolo/*.txt`): one object per line, normalised to [0, 1]:

```
<class_id> <x_center> <y_center> <width> <height>
0 0.976250 0.516667 0.047500 0.044444
```

Class `0` = `car`.

**COCO** (`labels/coco/*.json`): one JSON file per scene with `images`, `annotations`
(`bbox` as `[x, y, w, h]` in pixels, polygon `segmentation`, `area`) and `categories`.
The category list contains `car (0)`, `traffic_light (1)`, `traffic_sign (2)`,
`pedestrian (3)` and `entity (99)`, but only `car` is annotated in this release.
Note: `images[].file_name` has the `output_dataset/` prefix, e.g.
`output_dataset/images/scene_00000.png`.

**KITTI** (`labels/kitti/*.txt`): standard KITTI object label format, 15 fields per line:

```
type truncated occluded alpha  x1 y1 x2 y2  h w l  x y z  rotation_y
Car  1.00      0        2.15   1524 445 1600 485  1.88 2.16 4.88  37.32 1.66 56.71  1.57
```

Dimensions and location are in metres in camera coordinates. The camera intrinsics are
in `metadata/scene_XXXXX.json` → `camera.intrinsic_matrix`.

**Depth** (`depth/*.npy`): `float32` array of shape `(900, 1600)` with per-pixel depth
in metres, clipped to the far plane (150 m).

**Metadata** (`metadata/scene_XXXXX.json`): `scene_id`, `timestamp`, `image_path`,
`camera` (`position`, `target`, `up`, `fov_deg`, `near`, `far`, `intrinsic_matrix`,
`extrinsic_matrix`), `objects` (class, world pose, scale, 2D/3D boxes, visibility,
occlusion ratio), `render_config`, and `stats`.

## Quick start

```python
import json
import numpy as np
from PIL import Image

root = "data/output_dataset"
sid = "scene_00000"

rgb   = np.array(Image.open(f"{root}/images/{sid}.png"))   # (900, 1600, 3) uint8
depth = np.load(f"{root}/depth/{sid}.npy")                  # (900, 1600) float32, metres
mask  = np.array(Image.open(f"{root}/masks/{sid}.png"))    # (900, 1600, 3) uint8
meta  = json.load(open(f"{root}/metadata/{sid}.json"))
K     = np.array(meta["camera"]["intrinsic_matrix"])        # 3×3

with open(f"{root}/labels/yolo/{sid}.txt") as f:
    boxes = [list(map(float, line.split())) for line in f]

train_ids = open(f"{root}/ImageSets/train.txt").read().split()
print(rgb.shape, depth.min(), depth.max(), len(boxes), len(train_ids))
```

**Train YOLO (Ultralytics)**: write a `data.yaml` that points at the split lists:

```python
from pathlib import Path

root = Path("data/output_dataset").resolve()
for split in ["train", "val", "test"]:
    ids = (root / "ImageSets" / f"{split}.txt").read_text().split()
    (root / f"{split}_images.txt").write_text(
        "\n".join(str(root / "images" / f"scene_{i}.png") for i in ids)
    )
```

YOLO looks for labels next to the images (`images/` → `labels/`), so copy or symlink
`labels/yolo/*.txt` into a sibling `labels/` folder of the image directory, or use the
conversion scripts in the GitHub repo.

## Citation

```bibtex
@misc{visiondrive3d2026,
  title  = {VisionDrive3D: Synthetic Driving Data for Detection and Segmentation},
  author = {BenBunBo},
  year   = {2026},
  howpublished = {\url{https://huggingface.co/datasets/BenBunBo/VisionDrive3D}}
}
```