File size: 5,073 Bytes
595f4e6
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2876545
 
 
 
 
 
 
 
 
 
 
 
 
 
 
595f4e6
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4f772b3
595f4e6
 
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
# CameraBench Binary Evaluation Dataset

A balanced VQA dataset for evaluating camera motion understanding in videos.

## πŸ“Š Dataset Statistics

- **Total Questions**: 232
- **Unique Videos**: 115
- **Unique Questions**: 15
- **Yes Answers**: 116 (50.0%)
- **No Answers**: 116 (50.0%)
- **Balance Ratio**: 1.00
- **Total Size**: 121.22 MB (0.12 GB)
- **Average Video Size**: 1.05 MB

## 🎯 Task Categories

This dataset covers various camera motion tasks including:
- **Static**: 39 questions
- **Move In**: 27 questions
- **Pan Right**: 26 questions
- **Roll Counterclockwise**: 22 questions
- **Pan Left**: 21 questions
- **Move Left**: 20 questions
- **Roll Clockwise**: 18 questions
- **Move Up**: 18 questions
- **Move Out**: 18 questions
- **Tilt Up**: 17 questions
- **Move Right**: 14 questions
- **Move Down**: 14 questions
- **Zoom In**: 14 questions
- **Tilt Down**: 13 questions
- **Zoom Out**: 12 questions


## πŸ“ Dataset Format

Each record contains:
- `video_name`: Original video filename
- `video`: Video file (MP4 format, original quality)
- `question`: Binary question about camera motion
- `label`: Answer ("Yes" or "No")
- `task`: Task category
- `label_name`: Detailed label identifier

## 🎬 Sample Questions and Videos

Below are animated GIF previews of sample videos from the dataset:



## πŸš€ Usage

### Loading the Dataset

```python
from datasets import load_dataset

# Load the dataset
dataset = load_dataset("cambench_binary_eval")

# Access a sample
sample = dataset['train'][0]
print(f"Question: {sample['question']}")
print(f"Answer: {sample['label']}")
print(f"Task: {sample['task']}")

# The video field contains the path to download
video_file = sample['video']
```

### Downloading Videos

Videos are embedded in the dataset. To download and use them:

```python
from datasets import load_dataset
import os
import shutil

# Load the dataset
dataset = load_dataset("cambench_binary_eval")

# Download all videos to a local directory
output_dir = "downloaded_videos"
os.makedirs(output_dir, exist_ok=True)

for idx, sample in enumerate(dataset['train']):
    video_name = sample['video_name']
    video_data = sample['video']  # This contains the video file data
    
    # Save video to local disk
    local_path = os.path.join(output_dir, video_name)
    
    # If video_data is a file path (during local testing)
    if isinstance(video_data, str) and os.path.exists(video_data):
        shutil.copy2(video_data, local_path)
    else:
        # Video data from HuggingFace - write bytes to file
        with open(local_path, 'wb') as f:
            f.write(video_data)
    
    print(f"Downloaded: {video_name} -> {local_path}")

print(f"All {len(dataset['train'])} videos downloaded to {output_dir}/")
```

### Accessing Individual Videos

To download a specific video by name:

```python
from datasets import load_dataset
import os

dataset = load_dataset("cambench_binary_eval")

# Find and download a specific video
target_video = "your_video_name.mp4"
for sample in dataset['train']:
    if sample['video_name'] == target_video:
        video_data = sample['video']
        
        # Save to current directory
        with open(target_video, 'wb') as f:
            f.write(video_data)
        
        print(f"Downloaded: {target_video}")
        break
else:
    print(f"Video {target_video} not found in dataset")
```

### Batch Processing

For evaluation tasks:

```python
from datasets import load_dataset

dataset = load_dataset("cambench_binary_eval")

correct = 0
total = 0

for sample in dataset['train']:
    video_path = sample['video']
    question = sample['question']
    ground_truth = sample['label']
    
    # Your model inference here
    # prediction = your_model(video_path, question)
    
    # if prediction == ground_truth:
    #     correct += 1
    # total += 1

# accuracy = correct / total if total > 0 else 0
# print(f"Accuracy: {accuracy:.2%}")
```

## πŸ“₯ Alternative: Download Full Dataset

To download the entire dataset with all videos at once:

```bash
# Using huggingface-cli
huggingface-cli download cambench_binary_eval --repo-type dataset --local-dir ./cambench_data

# Or using Python
from huggingface_hub import snapshot_download
snapshot_download(repo_id="cambench_binary_eval", repo_type="dataset", local_dir="./cambench_data")
```

This will download all videos and data files to your local machine.

## πŸ“Š Evaluation

This dataset is designed for binary classification tasks. Evaluate your model using:
- Accuracy
- Precision/Recall
- F1 Score
- Per-task performance

## πŸ“„ License

Please refer to the original CameraBench dataset for licensing information.

## πŸ™ Citation

If you use this dataset, please cite the original CameraBench paper.

## πŸ“§ Contact

For questions or issues, please open an issue on the repository.

---

**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.