VisionDrive3D / README.md
BenBunBo's picture
Add VisionDrive3D dataset card
99f2060 verified
|
Raw History Blame Contribute Delete
6.98 kB
---
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}}
}
```