File size: 4,874 Bytes
510da4f
 
 
 
 
03143b6
516f324
 
 
 
 
 
 
510da4f
b13b013
 
595f4e6
 
 
 
 
 
a88f255
 
03143b6
a88f255
 
595f4e6
a88f255
 
595f4e6
 
 
 
a88f255
03143b6
 
516f324
03143b6
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
516f324
98f122e
03143b6
 
595f4e6
 
 
a7f9c4f
 
 
 
 
595f4e6
a7f9c4f
595f4e6
 
 
 
 
 
 
 
 
 
a7f9c4f
 
595f4e6
a7f9c4f
 
 
 
 
595f4e6
 
a7f9c4f
595f4e6
 
 
a7f9c4f
595f4e6
 
a7f9c4f
595f4e6
a7f9c4f
595f4e6
a7f9c4f
 
 
595f4e6
a7f9c4f
 
595f4e6
 
a7f9c4f
595f4e6
a7f9c4f
595f4e6
 
a7f9c4f
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
595f4e6
a7f9c4f
 
 
595f4e6
 
 
 
 
 
 
a7f9c4f
595f4e6
a7f9c4f
 
 
595f4e6
 
 
 
a7f9c4f
 
595f4e6
 
 
 
 
 
 
 
 
 
 
 
 
 
a7f9c4f
595f4e6
a7f9c4f
 
595f4e6
a7f9c4f
 
595f4e6
a7f9c4f
 
 
 
 
595f4e6
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4f772b3
595f4e6
a7f9c4f
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
---
configs:
- config_name: default
  data_files:
  - split: train
    path: data.jsonl
task_categories:
- visual-question-answering
- video-classification
language:
- en
size_categories:
- n<1K
---


# CameraBench Binary Evaluation Dataset

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

## πŸ“Š Dataset Statistics

- **Total Questions**: 384
- **Unique Videos**: 119
- **Unique Questions**: 31
- **Yes Answers**: 192 (50.0%)
- **No Answers**: 192 (50.0%)
- **Balance Ratio**: 1.00
- **Total Size**: 126.16 MB (0.12 GB)
- **Average Video Size**: 1.06 MB

## 🎯 Task Categories

This dataset covers various camera motion tasks including:

- **Static**: 42 questions
- **Move In**: 29 questions
- **Pan Left**: 24 questions
- **Tilt Up**: 24 questions
- **Move Out**: 21 questions
- **Move Right**: 19 questions
- **Roll Counterclockwise**: 18 questions
- **Pan Right**: 17 questions
- **Zoom Out**: 16 questions
- **Move Left**: 16 questions
- **Has Pan Left**: 15 questions
- **Roll Clockwise**: 15 questions
- **Zoom In**: 14 questions
- **Tilt Down**: 14 questions
- **Is The Fixed Camera Shaking Or Not**: 13 questions
- **Has Forward Motion**: 13 questions
- **Has Pan Right**: 12 questions
- **Is Scene Static Or Not**: 11 questions
- **Move Up**: 11 questions
- **Move Down**: 11 questions
- **Is The Camera Stable Or Shaky**: 9 questions
- **Has Truck Left**: 8 questions
- **Has Backward Motion**: 7 questions
- **Has Truck Right**: 6 questions
- **Has Forward Vs Backward Ground**: 4 questions
- **Has Zoom Out Not Move Vs Has Move Not Zoom Out**: 2 questions
- **Is Camera Movement Slow Or Fast**: 2 questions

## πŸ“ Dataset Format

The dataset consists of:
- `videos/`: Directory containing all MP4 video files
- `metadata.jsonl`: JSONL file with question annotations

Each record in `metadata.jsonl` contains:
- `video_name`: Original video filename
- `video_path`: Relative path to video file (e.g., `videos/video.mp4`)
- `question`: Binary question about camera motion
- `label`: Answer ("Yes" or "No")
- `task`: Task category
- `label_name`: Detailed label identifier

## πŸš€ Usage

### Loading the Dataset

```python
import json
import os

# Load metadata
metadata = []
with open("metadata.jsonl", "r") as f:
    for line in f:
        metadata.append(json.loads(line))

# Access a sample
sample = metadata[0]
print(f"Question: {sample['question']}")
print(f"Answer: {sample['label']}")
print(f"Task: {sample['task']}")
print(f"Video path: {sample['video_path']}")
```

### Downloading the Dataset

Download the entire dataset using huggingface-cli or git:

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

# Or using git
git clone https://huggingface.co/datasets/tuhink/cambench_binary_eval
```

This will download all videos and metadata to your local machine.

### Loading Videos

```python
import json
import cv2

# Load metadata
with open("metadata.jsonl", "r") as f:
    metadata = [json.loads(line) for line in f]

# Load a video
sample = metadata[0]
video_path = sample['video_path']  # e.g., "videos/video_name.mp4"

# Use OpenCV to read the video
cap = cv2.VideoCapture(video_path)
while cap.isOpened():
    ret, frame = cap.read()
    if not ret:
        break
    # Process frame
    pass
cap.release()
```

### Batch Processing

For evaluation tasks:

```python
import json

# Load all questions
with open("metadata.jsonl", "r") as f:
    dataset = [json.loads(line) for line in f]

correct = 0
total = 0

for sample in dataset:
    video_path = sample['video_path']
    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%}")
```

### Using with HuggingFace Datasets Library

```python
from datasets import load_dataset

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

# Access samples
for sample in dataset['train']:
    print(f"Question: {sample['question']}")
    print(f"Answer: {sample['label']}")
    print(f"Video: {sample['video_path']}")
```

## πŸ“Š 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**: All videos are provided in original MP4 format. The dataset maintains temporal dynamics for accurate camera motion evaluation.