File size: 3,036 Bytes
f25c369
8aed0fa
 
4df0d65
8aed0fa
4df0d65
 
 
 
8aed0fa
 
4df0d65
f25c369
8aed0fa
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
---
license: cc-by-nc-4.0
task_categories:
  - image-segmentation
tags:
  - mirror-detection
  - video-understanding
  - video-mirror-detection
  - scene-understanding
pretty_name: VMD-D (Video Mirror Detection Dataset)
size_categories:
  - 10K<n<100K
---

# VMD-D — Video Mirror Detection Dataset

VMD-D is the first large-scale dataset for **Video Mirror Detection**, introduced in:

> **Learning to Detect Mirrors from Videos via Dual Correspondences**  
> Jiaying Lin\*, Xin Tan\*, Rynson W. H. Lau  
> CVPR 2023  
> [Paper](https://openaccess.thecvf.com/content/CVPR2023) · [Project Page](https://jiaying.link/cvpr2023-vmd/)

## Dataset Summary

VMD-D contains **14,987 image frames** from **269 videos** with corresponding manually annotated binary mirror masks. Videos are split into clips, and each clip is an independent sequence segment.

| Split | Clips | Frames |
|-------|------:|-------:|
| train | 144   | 7,836  |
| test  | 127   | 7,151  |

## Dataset Structure

Each sample has four columns:

| Column     | Type   | Description |
|------------|--------|-------------|
| `image_id` | string | Original path stem: `{clip_id}/{frame_id}`, e.g. `056_12/0001`. Enables round-trip fidelity. |
| `clip_id`  | string | Video clip identifier, e.g. `056_12` |
| `image`    | Image  | JPEG video frame |
| `mask`     | Image  | PNG binary segmentation mask (mirror = white, background = black) |

The original on-disk layout is:
```
VMD/
  train/
    {clip_id}/
      JPEGImages/            # {frame}.jpg
      SegmentationClassPNG/  # {frame}.png
  test/

```

## Loading the Dataset

```python
from datasets import load_dataset

ds = load_dataset("garrying/VMD-D")
# or load a single split:
train_ds = load_dataset("garrying/VMD-D", split="train")
test_ds  = load_dataset("garrying/VMD-D", split="test")

sample = train_ds[0]
print(sample["image_id"])   # e.g. "056_12/0001"
sample["image"].show()
sample["mask"].show()
```

## Converting Back to Raw Files

A helper script `parquet_to_raw.py` is included in this repo to restore the original directory structure:

```bash
# Download the helper
huggingface-cli download garrying/VMD-D parquet_to_raw.py --repo-type dataset

# Restore all splits from HuggingFace
python parquet_to_raw.py --repo garrying/VMD-D

# Restore only the test split to a custom directory
python parquet_to_raw.py --repo garrying/VMD-D --splits test --out VMD_test
```

Output structure matches the original:
```
VMD/
  train/{clip_id}/JPEGImages/{frame}.jpg
  train/{clip_id}/SegmentationClassPNG/{frame}.png
  test/…
```

## Citation

```bibtex
@InProceedings{Lin_2023_CVPR,
  author    = {Lin, Jiaying and Tan, Xin and Lau, Rynson W. H.},
  title     = {Learning to Detect Mirrors from Videos via Dual Correspondences},
  booktitle = {Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR)},
  year      = {2023},
}
```

## License

This dataset is released under [CC BY-NC 4.0](https://creativecommons.org/licenses/by-nc/4.0/). Non-commercial use only.