junha1125 commited on
Commit
72aaefe
·
verified ·
1 Parent(s): b2c8128

Upload README.md with huggingface_hub

Browse files
Files changed (1) hide show
  1. README.md +203 -0
README.md ADDED
@@ -0,0 +1,203 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: cc-by-4.0
3
+ language:
4
+ - en
5
+ task_categories:
6
+ - image-to-text
7
+ - image-feature-extraction
8
+ tags:
9
+ - video
10
+ - world-model
11
+ - frame-sequence
12
+ - temporal
13
+ - openvid
14
+ size_categories:
15
+ - 100K<n<1M
16
+ configs:
17
+ - config_name: index
18
+ data_files: sequences.jsonl
19
+ ---
20
+
21
+ # OpenVid Frame Sequences — 1M adjacent frame pairs
22
+
23
+ Short, single-shot frame sequences cut from [OpenVid-1M](https://huggingface.co/datasets/nkp37/OpenVid-1M),
24
+ built to train and evaluate models on **what changes between two frames half a second apart**.
25
+
26
+ One sample = **10 consecutive frames, 0.5 s apart** (a 4.5 s span) → **9 adjacent frame pairs**.
27
+
28
+ ```
29
+ [f00] --0.5s--> [f01] --0.5s--> [f02] ... [f09]
30
+ ^ the thing you describe / predict
31
+ ```
32
+
33
+ | | |
34
+ |---|---|
35
+ | Sequences | **116,596** |
36
+ | Frames per sequence | 10 (0.5 s apart, t = 0.0 … 4.5 s) |
37
+ | **Adjacent frame pairs** | **1,049,364** |
38
+ | Source clips | 87,002 (**at most 2 sequences per clip**) |
39
+ | Images | 1,165,960 JPEGs, 768 px wide, q=3, mean 44 KB |
40
+ | Download size | ~53 GB (frames) + 145 MB (index) |
41
+
42
+ Source videos are **not** included — see [OpenVid-1M](https://huggingface.co/datasets/nkp37/OpenVid-1M)
43
+ for those. Every sequence carries the clip name and timestamps, so the source frames are recoverable.
44
+
45
+ ## Why this exists
46
+
47
+ Video-caption datasets describe a whole clip. Training a model to reason about *change*
48
+ needs pairs that are close enough in time to share a scene, but far enough apart that
49
+ something actually happened. This dataset fixes that interval at 0.5 s and filters for
50
+ clips where motion is real, so that a difference caption between `f_i` and `f_i+1` is
51
+ never "nothing changed".
52
+
53
+ Measured on a uniform random sample: **mean absolute pixel change between adjacent frames
54
+ is 16.6 / 255** (median 15.5), and only **1.0%** of sequences are effectively static.
55
+
56
+ ## Selection criteria
57
+
58
+ Applied to the full OpenVid-1M metadata (1,019,957 clips) before downloading a single byte:
59
+
60
+ ```
61
+ motion score ∈ [5.27, 60] # 5.27 = top 29.5% of the candidate pool
62
+ aesthetic score ≥ 5.0
63
+ duration ≥ 4.75 s (one window) / ≥ 9.75 s (two windows)
64
+ sequences/clip ≤ 2 # so no single video dominates the data
65
+ caption must not match talk|talking|interview|podcast
66
+ clip name must not start with celebv_ or pixabay_
67
+ camera motion unconstrained
68
+ ```
69
+
70
+ Capping at 2 sequences per clip matters: without it a handful of long videos contribute
71
+ hundreds of near-identical sequences each.
72
+
73
+ Camera motion is deliberately **not** constrained — pans and zooms are themselves valid
74
+ visual change. The resulting mix is **63.4% static / 36.6% moving**
75
+ (pan_right 7.8%, pan_left 7.0%, undetermined 6.5%, zoom_in 2.8%, tilt_up 2.2%, …).
76
+
77
+ ## Composition
78
+
79
+ | | |
80
+ |---|---|
81
+ | camera | static 63.4% · moving 36.6% |
82
+ | source resolution | 64.9% from 1080p originals (all resized to 768 px wide) |
83
+ | motion score | min 5.27 · p25 6.76 · **median 9.74** · p75 20.95 · max 60.00 |
84
+ | source clip length | median 9.8 s |
85
+ | windows per clip | 1 window: 57,408 clips · 2 windows: 29,594 clips |
86
+
87
+ ## Files
88
+
89
+ ```
90
+ frames/frames-000.tar … frames-063.tar 64 shards, ~850 MB each, 53 GB total
91
+ sequences.jsonl 116,596 lines — the index
92
+ meta/manifest.csv 111,536 rows: the full filtered candidate list
93
+ meta/part_index.jsonl 1,019,957 rows: clip -> (OpenVid zip part, member, bytes)
94
+ scripts/ the pipeline that produced this
95
+ docs/ build runbook and result notes (Korean)
96
+ ```
97
+
98
+ Each tar extracts to `frames/<2-hex shard>/<clip>__w<N>/f00.jpg … f09.jpg`, which is exactly
99
+ the path written in `sequences.jsonl`. Extract every shard into the same directory and the
100
+ index paths resolve as-is.
101
+
102
+ The 2-hex sharding (`md5(sequence_id)[:2]`) keeps any one directory under ~500 entries,
103
+ which matters on network filesystems.
104
+
105
+ ## Getting it
106
+
107
+ ```bash
108
+ pip install huggingface_hub
109
+ hf download junha1125/openvid-frame-sequences-1M --repo-type dataset --local-dir openvid_seq
110
+ cd openvid_seq && for t in frames/*.tar; do tar -xf "$t"; done
111
+ ```
112
+
113
+ ## A line of `sequences.jsonl`
114
+
115
+ ```json
116
+ {
117
+ "id": "<clip>__w0",
118
+ "video": "<clip>.mp4",
119
+ "frames": ["frames/90/<clip>__w0/f00.jpg", "...", "frames/90/<clip>__w0/f09.jpg"],
120
+ "timestamps": [0.0, 0.5, 1.0, 1.5, 2.0, 2.5, 3.0, 3.5, 4.0, 4.5],
121
+ "step_sec": 0.5,
122
+ "n_frames": 10,
123
+ "video_caption": "the original OpenVid caption for the whole clip",
124
+ "meta": {"seconds": "...", "fps": "...", "motion": "...",
125
+ "aesthetic": "...", "camera": "...", "hd": "1"}
126
+ }
127
+ ```
128
+
129
+ Window `w` frame `i` is the source video at `w * 5.0 + i * 0.5` seconds.
130
+ `video_caption` is the OpenVid caption for the *entire* clip, not for this window —
131
+ it is useful as context for a captioning prompt, not as a label.
132
+
133
+ ```python
134
+ import json
135
+ seqs = [json.loads(l) for l in open("sequences.jsonl")]
136
+ pairs = [(s["frames"][i], s["frames"][i+1], s) for s in seqs for i in range(9)]
137
+ len(pairs) # 1,049,364
138
+ ```
139
+
140
+ ## Integrity
141
+
142
+ Every one of the 1,165,960 frame paths in `sequences.jsonl` was stat-checked against disk:
143
+ 0 missing, 0 orphan JPEGs, 0 duplicate ids, 0 clips over the 2-sequence cap, all sequences
144
+ exactly 10 frames at exactly 0.5 s spacing, no sequence below the motion floor.
145
+ The 64 tars hold 1,282,812 entries = 1,165,960 JPEGs + 116,596 sequence dirs + 256 shard dirs.
146
+
147
+ ## Known limitations
148
+
149
+ - **Shot changes: ~3.2% of sequences.** OpenVid's scene segmentation is not perfect, so a
150
+ small fraction of sequences contain a cut. If a pair looks like two unrelated scenes,
151
+ drop it. This is measurable — a single adjacent pair whose pixel delta is several times
152
+ the sequence's own median is almost always a cut.
153
+ - **Residual talking-head footage.** The caption filter only matches
154
+ `talk|talking|interview|podcast`, so clips where someone talks to the camera without those
155
+ words in the caption (driving-and-talking, lecture footage) survive. Tighten
156
+ `TALKING` in `scripts/select_clips.py` if that hurts your use case.
157
+ - `video_caption` describes the whole source clip, so it can mention things not visible in
158
+ a given 4.5 s window.
159
+ - Frames are re-encoded JPEG at q=3 from already-compressed video; fine detail is lossy.
160
+
161
+ ## Reproducing / extending
162
+
163
+ `scripts/` contains the full pipeline. `meta/manifest.csv` is fixed-order with a `cum_gb`
164
+ column, so raising the byte budget downloads only the next slice:
165
+
166
+ ```bash
167
+ python3 scripts/fetch_clips.py --budget-gb 800 --workers 32 # this release used 600
168
+ python3 scripts/extract_frames.py --workers 176 # existing windows are skipped
169
+ python3 scripts/verify_dataset.py --full
170
+ ```
171
+
172
+ | budget | clips | sequences | adjacent pairs |
173
+ |---|---|---|---|
174
+ | **600 GB** (this release) | 84,362 | 111,417 | 1,002,753 |
175
+ | 800 GB | 96,176 | 128,540 | 1,156,860 |
176
+ | 1,000 GB | 104,216 | 140,898 | 1,268,082 |
177
+ | 1,390 GB (all) | 111,536 | 153,391 | 1,380,519 |
178
+
179
+ This release has slightly more than the 600 GB row because 2,640 clips from beyond the
180
+ budget were already on disk and were extracted too.
181
+
182
+ Note for anyone pulling clips out of the OpenVid zips: `zipfile.ZipFile.read()` costs 3–4
183
+ HTTP round trips per member and Hugging Face throttles on request count, not bytes.
184
+ `scripts/hfzip.py:read_member()` fetches the local header and payload in one Range request
185
+ and parses it directly — 2.5× faster in practice (19 → 58 MB/s).
186
+
187
+ ## License and attribution
188
+
189
+ **CC-BY-4.0**, inherited from OpenVid-1M. These are frames extracted from OpenVid-1M clips;
190
+ all credit for the underlying video collection and its captions goes to its authors.
191
+
192
+ ```bibtex
193
+ @article{nan2024openvid,
194
+ title = {OpenVid-1M: A Large-Scale High-Quality Dataset for Text-to-video Generation},
195
+ author = {Nan, Kepan and Xie, Rui and Zhou, Penghao and Fan, Tiehan and
196
+ Yang, Zhenheng and Chen, Zhijie and Li, Xiang and Yang, Jian and Tai, Ying},
197
+ journal = {arXiv preprint arXiv:2407.02371},
198
+ year = {2024}
199
+ }
200
+ ```
201
+
202
+ Intended for research use. The underlying clips are sourced from public video platforms;
203
+ the OpenVid authors' terms and takedown process apply to them.