tuhink commited on
Commit
595f4e6
Β·
verified Β·
1 Parent(s): 257399c

Add README with dataset documentation and sample GIFs

Browse files
Files changed (1) hide show
  1. README.md +198 -26
README.md CHANGED
@@ -1,27 +1,199 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
2
- dataset_info:
3
- features:
4
- - name: video_name
5
- dtype: string
6
- - name: video
7
- dtype: string
8
- - name: question
9
- dtype: string
10
- - name: label
11
- dtype: string
12
- - name: task
13
- dtype: string
14
- - name: label_name
15
- dtype: string
16
- splits:
17
- - name: train
18
- num_bytes: 51960
19
- num_examples: 272
20
- download_size: 8816
21
- dataset_size: 51960
22
- configs:
23
- - config_name: default
24
- data_files:
25
- - split: train
26
- path: data/train-*
27
- ---
 
1
+ # CameraBench Binary Evaluation Dataset
2
+
3
+ A balanced VQA dataset for evaluating camera motion understanding in videos.
4
+
5
+ ## πŸ“Š Dataset Statistics
6
+
7
+ - **Total Questions**: 232
8
+ - **Unique Videos**: 115
9
+ - **Unique Questions**: 15
10
+ - **Yes Answers**: 116 (50.0%)
11
+ - **No Answers**: 116 (50.0%)
12
+ - **Balance Ratio**: 1.00
13
+ - **Total Size**: 121.22 MB (0.12 GB)
14
+ - **Average Video Size**: 1.05 MB
15
+
16
+ ## 🎯 Task Categories
17
+
18
+ This dataset covers various camera motion tasks including:
19
+ - **Static**: 44 questions
20
+ - **Move In**: 26 questions
21
+ - **Pan Right**: 25 questions
22
+ - **Roll Counterclockwise**: 19 questions
23
+ - **Pan Left**: 17 questions
24
+ - **Roll Clockwise**: 17 questions
25
+ - **Move Right**: 16 questions
26
+ - **Move Out**: 16 questions
27
+ - **Tilt Down**: 15 questions
28
+ - **Zoom In**: 14 questions
29
+ - **Zoom Out**: 14 questions
30
+ - **Move Up**: 14 questions
31
+ - **Move Left**: 14 questions
32
+ - **Tilt Up**: 12 questions
33
+ - **Move Down**: 9 questions
34
+
35
+
36
+ ## πŸ“ Dataset Format
37
+
38
+ Each record contains:
39
+ - `video_name`: Original video filename
40
+ - `video`: Video file (MP4 format, original quality)
41
+ - `question`: Binary question about camera motion
42
+ - `label`: Answer ("Yes" or "No")
43
+ - `task`: Task category
44
+ - `label_name`: Detailed label identifier
45
+
46
+ ## 🎬 Sample Questions and Videos
47
+
48
+ Below are animated GIF previews of sample videos from the dataset:
49
+
50
+
51
+
52
+ ## πŸš€ Usage
53
+
54
+ ### Loading the Dataset
55
+
56
+ ```python
57
+ from datasets import load_dataset
58
+
59
+ # Load the dataset
60
+ dataset = load_dataset("cambench_binary_eval")
61
+
62
+ # Access a sample
63
+ sample = dataset['train'][0]
64
+ print(f"Question: {sample['question']}")
65
+ print(f"Answer: {sample['label']}")
66
+ print(f"Task: {sample['task']}")
67
+
68
+ # The video field contains the path to download
69
+ video_file = sample['video']
70
+ ```
71
+
72
+ ### Downloading Videos
73
+
74
+ Videos are embedded in the dataset. To download and use them:
75
+
76
+ ```python
77
+ from datasets import load_dataset
78
+ import os
79
+ import shutil
80
+
81
+ # Load the dataset
82
+ dataset = load_dataset("cambench_binary_eval")
83
+
84
+ # Download all videos to a local directory
85
+ output_dir = "downloaded_videos"
86
+ os.makedirs(output_dir, exist_ok=True)
87
+
88
+ for idx, sample in enumerate(dataset['train']):
89
+ video_name = sample['video_name']
90
+ video_data = sample['video'] # This contains the video file data
91
+
92
+ # Save video to local disk
93
+ local_path = os.path.join(output_dir, video_name)
94
+
95
+ # If video_data is a file path (during local testing)
96
+ if isinstance(video_data, str) and os.path.exists(video_data):
97
+ shutil.copy2(video_data, local_path)
98
+ else:
99
+ # Video data from HuggingFace - write bytes to file
100
+ with open(local_path, 'wb') as f:
101
+ f.write(video_data)
102
+
103
+ print(f"Downloaded: {video_name} -> {local_path}")
104
+
105
+ print(f"All {len(dataset['train'])} videos downloaded to {output_dir}/")
106
+ ```
107
+
108
+ ### Accessing Individual Videos
109
+
110
+ To download a specific video by name:
111
+
112
+ ```python
113
+ from datasets import load_dataset
114
+ import os
115
+
116
+ dataset = load_dataset("cambench_binary_eval")
117
+
118
+ # Find and download a specific video
119
+ target_video = "your_video_name.mp4"
120
+ for sample in dataset['train']:
121
+ if sample['video_name'] == target_video:
122
+ video_data = sample['video']
123
+
124
+ # Save to current directory
125
+ with open(target_video, 'wb') as f:
126
+ f.write(video_data)
127
+
128
+ print(f"Downloaded: {target_video}")
129
+ break
130
+ else:
131
+ print(f"Video {target_video} not found in dataset")
132
+ ```
133
+
134
+ ### Batch Processing
135
+
136
+ For evaluation tasks:
137
+
138
+ ```python
139
+ from datasets import load_dataset
140
+
141
+ dataset = load_dataset("cambench_binary_eval")
142
+
143
+ correct = 0
144
+ total = 0
145
+
146
+ for sample in dataset['train']:
147
+ video_path = sample['video']
148
+ question = sample['question']
149
+ ground_truth = sample['label']
150
+
151
+ # Your model inference here
152
+ # prediction = your_model(video_path, question)
153
+
154
+ # if prediction == ground_truth:
155
+ # correct += 1
156
+ # total += 1
157
+
158
+ # accuracy = correct / total if total > 0 else 0
159
+ # print(f"Accuracy: {accuracy:.2%}")
160
+ ```
161
+
162
+ ## πŸ“₯ Alternative: Download Full Dataset
163
+
164
+ To download the entire dataset with all videos at once:
165
+
166
+ ```bash
167
+ # Using huggingface-cli
168
+ huggingface-cli download cambench_binary_eval --repo-type dataset --local-dir ./cambench_data
169
+
170
+ # Or using Python
171
+ from huggingface_hub import snapshot_download
172
+ snapshot_download(repo_id="cambench_binary_eval", repo_type="dataset", local_dir="./cambench_data")
173
+ ```
174
+
175
+ This will download all videos and data files to your local machine.
176
+
177
+ ## πŸ“Š Evaluation
178
+
179
+ This dataset is designed for binary classification tasks. Evaluate your model using:
180
+ - Accuracy
181
+ - Precision/Recall
182
+ - F1 Score
183
+ - Per-task performance
184
+
185
+ ## πŸ“„ License
186
+
187
+ Please refer to the original CameraBench dataset for licensing information.
188
+
189
+ ## πŸ™ Citation
190
+
191
+ If you use this dataset, please cite the original CameraBench paper.
192
+
193
+ ## πŸ“§ Contact
194
+
195
+ For questions or issues, please open an issue on the repository.
196
+
197
  ---
198
+
199
+ **Note**: Videos are provided in MP4 format. Large videos (>50MB) are automatically compressed to ensure smooth downloading and processing. All videos maintain their original temporal dynamics for accurate camera motion evaluation.