Max-Ploter's picture
Update README.md
5c5287c verified
---
license: apache-2.0
task_categories:
- object-detection
language:
- en
pretty_name: Detection Moving MNIST (Easy)
size_categories:
- 100K<n<1M
---
# Detection Moving MNIST (Easy)
| | |
|:--------:|:---------:|
| ![annotated_video_0](./annotated_video_0.gif) | ![annotated_video_1](./annotated_video_1.gif) |
### Description
**Repository:** https://github.com/maxploter/detection-moving-mnist
A synthetic video dataset for object detection and tracking, featuring moving MNIST digits with:
- 1-10 digits per sequence
- Linear trajectories with small random translations
- 128x128 resolution grayscale frames
- 20 frames per video sequence
- Digit size 28x28
- Per-frame annotations including:
- Digit labels (0-9)
- Center coordinates (x,y)
### Supported Tasks
- Object detection in video
- Multi-object tracking
- Video understanding
- Spatiotemporal modeling
## Structure
### Data Instances
A typical example contains:
```python
{
'video': [video frames], # Array of shape (20, 128, 128, 3)
'targets': [{
'labels': List[int], # Digit classes present
'center_points': List[Tuple], # (x,y) coordinates
} for each frame]
}
```
### Data Format
- Arrow
- Total dataset size: approximately {PLACEHOLDER} GB
- Frame rate: 10 fps
## Data Splits
| Split | Size |
|--------|----------|
| Train | 60,000 |
| Test | 10,000 |
## Dataset Creation
### Source Data
- Original MNIST Dataset: http://yann.lecun.com/exdb/mnist/
- Synthetic Generation: Custom Moving MNIST implementation
## Annotations
- Automatically generated during sequence creation
- Includes digit classes and trajectory coordinates
### Simulation Parameters (Easy Mode)
```
{
"angle": (0, 0), # No rotation
"translate": ((-5, 5), (-5, 5)), # Small random translations
"scale": (1, 1), # Fixed size
"shear": (0, 0), # No deformation
"num_digits": (1,2,3,4,5,6,7,8,9,10) # Variable object count
}
```
## Dataset Statistics
| Statistic | Value |
|------------------------------|-------------------|
| Mean (Train) | 0.023958550628466375 |
| Standard Deviation (Train) | 0.14140212075592035 |
| Mean (Test) | 0.024210869560423308 |
| Standard Deviation (Test) | 0.1423791946229605 |
You can check those numbers in the file: [dataset_stats](./dataset_stats.json)
![train_digit_classes](./train_digit_classes.png)
![test_digit_classes](./test_digit_classes.png)
![train_digits_per_frame](./train_digits_per_frame.png)
![test_digits_per_frame](./test_digits_per_frame.png)
## Using the Dataset
### Basic Loading
```python
from datasets import load_dataset
dataset = load_dataset("Max-Ploter/detection-moving-mnist-easy")
```
### Visualization Example
```python
import matplotlib.pyplot as plt
import matplotlib.patches as patches
# Load a single example
example = dataset['train'][0]
frames = example['video']
annotations = example['targets']
# Visualize first frame with bounding boxes
plt.figure(figsize=(8, 8))
plt.imshow(frames[0], cmap='gray')
# Draw bounding boxes
for label, center in zip(annotations[0]['labels'], annotations[0]['center_points']):
x, y = center
# Assuming digit size of approximately 28x28 pixels
rect = patches.Rectangle((x-14, y-14), 28, 28, linewidth=1,
edgecolor='r', facecolor='none')
plt.gca().add_patch(rect)
plt.text(x, y-20, str(label), color='white', fontsize=12,
bbox=dict(facecolor='red', alpha=0.5))
plt.title('Frame 0 with Object Detection')
plt.axis('off')
plt.show()
```
## Limitations
- Synthetic dataset with simple black backgrounds
- Linear trajectories may not represent complex real-world motion
- No complex occlusion handling or object interactions
- No lighting variations or perspective transformations
## Related Datasets
- Original Moving MNIST: http://www.cs.toronto.edu/~nitish/unsupervised_video/