Datasets:

Modalities:
Text
Formats:
parquet
ArXiv:
Libraries:
Datasets
pandas
File size: 9,728 Bytes
10a4acf
 
 
4843533
10a4acf
 
9dec5d5
4843533
 
 
10a4acf
 
9dec5d5
eeba5f1
 
 
 
 
 
 
 
 
 
 
 
10a4acf
 
9dec5d5
 
 
8f87cad
 
 
10a4acf
 
8f87cad
 
10a4acf
8f87cad
 
 
 
 
10a4acf
 
8f87cad
 
 
 
9dec5d5
 
8f87cad
 
 
 
46f4f70
 
10a4acf
4843533
9dec5d5
46f4f70
10a4acf
9dec5d5
10a4acf
9dec5d5
 
10a4acf
 
 
4843533
8f87cad
10a4acf
 
 
c0f6b3f
 
e18de20
4861b51
 
60d4795
4861b51
 
 
60d4795
 
4861b51
 
 
60d4795
4861b51
 
 
 
60d4795
 
e18de20
4861b51
 
 
 
c0f6b3f
 
4861b51
 
 
c0f6b3f
e18de20
c0f6b3f
 
4861b51
 
 
e18de20
4861b51
 
 
 
 
 
 
e18de20
4861b51
 
 
 
 
 
 
 
ee6abc6
 
 
4861b51
 
 
 
 
e18de20
 
4861b51
 
 
 
 
 
ee6abc6
 
e18de20
4861b51
e18de20
 
 
4861b51
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
86b8ec4
 
 
ee6abc6
86b8ec4
 
 
 
 
 
 
 
 
 
ee6abc6
 
 
 
 
 
 
 
 
 
 
 
 
 
86b8ec4
 
e18de20
4861b51
e18de20
60d4795
e18de20
 
 
 
 
 
 
 
 
60d4795
e18de20
 
 
 
 
 
 
4861b51
c0f6b3f
e18de20
c0f6b3f
86b8ec4
c0f6b3f
 
 
e18de20
 
60d4795
e18de20
 
 
c0f6b3f
e18de20
c0f6b3f
 
e18de20
 
 
 
 
 
 
 
c0f6b3f
e18de20
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
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
---
dataset_info:
  features:
  - name: vclip_id
    dtype: string
  - name: question_id
    dtype: int64
  - name: question
    dtype: string
  - name: answer
    dtype: string
  - name: frame_indexes
    sequence: int64
  - name: choices
    struct:
    - name: A
      dtype: string
    - name: B
      dtype: string
    - name: C
      dtype: string
    - name: D
      dtype: string
    - name: E
      dtype: string
  - name: video_metadata
    struct:
    - name: CLIP-reference-interval-clip
      sequence: float64
    - name: CLIP-reference-interval-video
      sequence: float64
    - name: bitrate
      dtype: int64
    - name: codec
      dtype: string
    - name: frame_dimensions
      sequence: int64
    - name: frame_dimensions_resized
      sequence: int64
    - name: frame_rate
      dtype: float64
    - name: resolution
      dtype: string
    - name: resolution_resized
      dtype: string
    - name: vclip_duration
      dtype: float64
    - name: vclip_frame_count
      dtype: int64
    - name: vclip_interval_in_video
      sequence: float64
    - name: video_duration
      dtype: float64
    - name: video_frame_count
      dtype: int64
    - name: video_id
      dtype: string
  splits:
  - name: train
    num_bytes: 5358616
    num_examples: 11218
  - name: test
    num_bytes: 1977870
    num_examples: 3874
  download_size: 2168577
  dataset_size: 7336486
configs:
- config_name: default
  data_files:
  - split: train
    path: data/train-*
  - split: test
    path: data/test-*
---

<h1 align='center' style="text-align:center; font-weight:bold; font-size:2.0em;letter-spacing:2.0px;">
    LV-Haystack: Temporal Search for Long-Form Video Understanding</h1>    


<p align='center' style="text-align:center;font-size:1.1em;">
<a href="https://jhuiye.com/" target="_blank">Jinhui Ye<sup>1</sup></a>,&nbsp;
<a href="https://zihanwang314.github.io/" target="_blank">Zihan Wang<sup>2</sup></a>,&nbsp;
<a href="https://haosensun.github.io/" target="_blank">Haosen Sun<sup>2</sup></a>,&nbsp;
<a href="https://keshik6.github.io/" target="_blank">Keshigeyan Chandrasegaran<sup>1</sup></a>,&nbsp; <br>
<a href="https://zanedurante.github.io/" target="_blank">Zane Durante<sup>1</sup></a>,&nbsp;
<a href="https://ceyzaguirre4.github.io/" target="_blank">Cristobal Eyzaguirre<sup>1</sup></a>,&nbsp;
<a href="https://talkingtorobots.com/yonatanbisk.html" target="_blank">Yonatan Bisk<sup>3</sup></a>,&nbsp;
<a href="https://www.niebles.net/" target="_blank">Juan Carlos Niebles<sup>1</sup></a>,&nbsp;
<a href="https://profiles.stanford.edu/ehsan-adeli" target="_blank">Ehsan Adeli<sup>1</sup></a>,&nbsp;<br>
<a href="https://profiles.stanford.edu/fei-fei-li/" target="_blank">Li Fei-Fei<sup>1</sup></a>,&nbsp;
<a href="https://jiajunwu.com/" target="_blank">Jiajun Wu<sup>1</sup></a>,&nbsp;
<a href="https://limanling.github.io/" target="_blank">Manling Li<sup>2</sup></a><br/>
&nbsp;Stanford University<sup>1</sup>, Northwestern University<sup>2</sup>, Carnegie Mellon University<sup>3</sup><br/>
  <a align='center' style="text-decoration: none; color: gray">
  Dataset is part of the <a href="">T* project</a>
<br/>
<a href="https://examplewebsite.com" title="Website" target="_blank" rel="nofollow" style="text-decoration: none;">🌎Website</a> |
<a href="https://examplecode.com" title="Dataset" target="_blank" rel="nofollow" style="text-decoration: none;">🧑‍💻Code</a> |
<a href="https://arxiv.org/examplepaper" title="aXiv" target="_blank" rel="nofollow" style="text-decoration: none;">📄arXiv</a> |
<a href="https://exampleleaderboard.com" title="Leaderboard" target="_blank" rel="nofollow" style="text-decoration: none;">🏆 Leaderboard (Coming Soon)</a><br>
</p>

<img src="assets/img/logo.png" alt="Logo" width="400" height="auto" style="display:block; margin:auto;" />

<p align=center>

</p>





#### Dataset Sample

```python
{
    'vclip_id': '6338b73e-393f-4d37-b278-68703b45908c',
    'question_id': 10,
    'question': 'What nail did I pull out?',
    'answer': 'E',
    'frame_indexes': [5036, 5232], # the keyframe indexes
    'choices': {
        'A': 'The nail from the front wheel fender',
        'B': 'The nail from the motorcycle battery compartment',
        'C': 'The nail from the left side of the motorcycle seat',
        'D': 'The nail from the rearview mirror mount',
        'E': 'The nail on the right side of the motorcycle exhaust pipe'
    },
    'video_metadata': {
        'CLIP-reference-interval-vclip': [180.0, 240.0],  # Time interval of the "vclip" that is considered to be important by CLIP. this is calculated by (CLIP-reference-interval-video - vclip-interval-in-video[0])
        'CLIP-reference-interval-video': [180.0, 240.0],  # Time interval of the "video" that is considered to be important by CLIP. This is originally from the **Ego4D dataset**, used in our work for annotators to quickly locate in the video.
        'vclip_interval_in_video': [0.0, 480.06667277018227], # the vclip start and end second, i.e., for [a, b], the vclip starts at the a second of the video, ends at the b second of the video
        'frame_count': 14155,  # Total number of frames in the video
        'frame_rate': 30.0,  # Frame rate of the video
        'duration': 471.8333435058594,  # Duration of the video in seconds
        'resolution': '454x256',  # Original resolution of the video
        'frame_dimensions': None,  # Frame dimensions (if available)
        'codec': 'N/A',  # Codec used for the video (if available)
        'bitrate': 0,  # Bitrate of the video (if available)
        'frame_dimensions_resized': [340, 256],  # Resized frame dimensions
        'resolution_resized': '340x256',  # Resized resolution
        'video_id': 'b6ae365a-dd70-42c4-90d6-e0351778d991'  # Unique video identifier
    }
}
```


#### Dataset exploration

add hyperlink to demo

#### Dataset Usage

```python
from datasets import load_dataset
dataset = load_dataset("LVHaystack/LongVideoHaystack")
print(dataset)
```
```bash
>>> DatasetDict({
    train: Dataset({
        features: ['vclip_id', 'question_id', 'question', 'answer', 'frame_indexes', 'choices', 'video_metadata'],
        num_rows: 11218
    })
    test: Dataset({
        features: ['vclip_id', 'question_id', 'question', 'answer', 'frame_indexes', 'choices', 'video_metadata'],
        num_rows: 3874
    })
})
```

#### Video Source Download

TODO: We plan to provide a script of how to download a subset from [Ego4d](https://ego4d-data.org/).
For now, you can refer to their official guide [here](https://github.com/facebookresearch/Ego4d/tree/main/ego4d/cli). Your code would be look like the follows:
```bash
pip install ego4d

ego4d --output_directory=your_path/videos/ \
  --datasets full_scale annotations \
  --metadata \
  --video_uid_file video_uids.txt

python process_videos_to_clips.py
```
Please find [video_uid.txt](https://huggingface.co/datasets/LVHaystack/LongVideoHaystack/blob/main/video_uid.txt) in our repo, or you can generate it by:

```python
import datasets
metadata = datasets.load_dataset("LVHaystack/LongVideoHaystack-metadata")
with open("video_uids.txt", "w") as file:
    for video_id in metadata['video_id']:
        file.write(video_id + " ")
```

then, you need to transform them to video clips:
```python
```



#### Dataset Statistics Summary

| **Metric**                    | **Total**    | **Train**   | **Test**    |
|-------------------------------|--------------|-------------|-------------|
| **Video Statistics**           |              |             |             |
| Total Videos                   | **988**      | **744**     | **244**     |
| Total Video Duration (hr)      | 423.3        | 322.2       | 101.0       |
| Avg. Video Duration (min)      | 25.7         | 26.0        | 24.8        |
| **Clip Statistics**            |              |             |             |
| Total Video Clips              | **1,324**    | **996**     | **328**     |
| Total Video Clip Duration (hr) | 180.4        | 135.3       | 45.0        |
| Avg. Video Clip Duration (sec) | 8.2          | 8.2         | 8.2         |
| **Frame Statistics**           |              |             |             |
| Total Frames (k)               | **45,700**   | **34,800**  | **10,900**  |
| Avg. Frames per Video (k)      | 46.3         | 46.8        | 44.7        |
| Ratio of Keyframe / Frame (‰)  | 0.62         | 0.59        | 0.71        |
| **QA Statistics**              |              |             |             |
| Total QA Pairs                 | **15,092**   | **11,218**  | **3,874**   |
| Avg. QA Pair per Video         | 15.3         | 15.1        | 15.9        |
| Avg. QA Pair per Clip          | 11.4         | 11.3        | 11.8        |
| Avg. Keyframes per Question    | 1.88         | 1.84        | 2.01        |


#### Evaluation scripts

Please refer to [./eval.py](https://huggingface.co/datasets/LVHaystack/LongVideoHaystack/blob/main/eval.py).



#### Contact
- Jinhui Ye: [email protected]
- Zihan Wang: [email protected] (datasets)
- Haosen Sun: [email protected]
- Keshigeyan Chandrasegaran: [email protected]
- Manling Li: [email protected]

#### Citation

```bibtex
@misc{tstar,
      title={Re-thinking Temporal Search for Long-Form Video Understanding}, 
      author={Jinhui Ye and Zihan Wang and Haosen Sun and Keshigeyan Chandrasegaran and Zane Durante and Cristobal Eyzaguirre and Yonatan Bisk and Juan Carlos Niebles and Ehsan Adeli and Li Fei-Fei and Jiajun Wu and Manling Li},
      year={2025},
      eprint={2501.TODO},
      archivePrefix={arXiv},
      primaryClass={cs.LG}
}
```
Website template borrowed from [HourVideo](https://huggingface.co/datasets/HourVideo/HourVideo).