A Python-based video summarization tool that extracts contours from video frames to create condensed summaries. Perfect for analyzing surveillance footage, time-lapse videos, or any static camera recording where you want to extract and visualize movement over time.
- Processing Speed: ~20 seconds per minute of video (1:3 ratio)
- Memory Usage: Max 6GB RAM
**Component Breakdown:**
- CE = Contour Extractor
- LF = Layer Factory
- LM = Layer Manager
- EX = Exporter

## 🏗️ Architecture
```
Video-Summary/
├── Application/ # Core processing modules
│ ├── Config.py # Configuration management
│ ├── ContourExctractor.py # Movement detection
│ ├── LayerFactory.py # Layer extraction
│ ├── LayerManager.py # Layer optimization
│ ├── Exporter.py # Output generation
│ ├── VideoReader.py # Video I/O
│ ├── HeatMap.py # Heatmap generation
│ ├── Importer.py # Cache loading
│ ├── Layer.py # Layer data structure
│ └── Logger.py # Logging utilities
├── main.py # CLI entry point
├── pyproject.toml # Package configuration
└── requirements.txt # Dependencies
```
### Processing Pipeline
1.**Video Reading**: Load and preprocess video frames
2.**Contour Extraction**: Detect movement by comparing consecutive frames
3.**Layer Creation**: Group related contours across frames
4.**Layer Management**: Filter and optimize layers based on configuration
5.**Export**: Generate output video with overlaid movement and heatmap
## 🧪 Development
### Code Quality Tools
We use modern Python development tools:
- **Black**: Code formatting
- **isort**: Import sorting
- **flake8**: Linting
- **mypy**: Type checking
- **pre-commit**: Automated checks
```bash
# Install development dependencies
pip install -e ".[dev]"
# Install pre-commit hooks
pre-commit install
# Run formatting
black .
isort .
# Run linting
flake8 .
mypy Application/ main.py
```
### Running Tests
```bash
# Run all tests
pytest
# Run with coverage
pytest --cov=Application --cov-report=html
```
## 📝 Contributing
We welcome contributions! Please see [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines.
## 📄 License
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
The original Creative Commons licensed documentation can be found in [licens.txt](licens.txt).
## 🙏 Acknowledgments
- Built with OpenCV, NumPy, and imageio
- Inspired by video synopsis research in computer vision
## 📮 Contact
For questions or issues, please [open an issue](https://github.com/Askill/Video-Summary/issues) on GitHub.
---
**Note**: TensorFlow support is optional and not required for core functionality. The project works perfectly fine without GPU acceleration, though processing times will be longer for large videos.