This directory contains comprehensive examples demonstrating the capabilities of the Musical Gestures Toolbox for Python.
If you're new to MGT-python, start with these examples in order:
advanced_video_processing.py- Comprehensive video analysis introductionaudio_analysis_example.py- Audio processing featuresbatch_processing_example.py- Process multiple files efficientlypose_estimation_example.py- Human pose tracking and analysis
advanced_video_processing.py- Advanced video processing techniques with multiple analysis methodsaudio_analysis_example.py- Comprehensive audio analysis and feature extractionbatch_processing_example.py- Batch processing multiple videos with progress trackingpose_estimation_example.py- Human pose estimation and movement analysis
notebooks/comprehensive_tutorial.ipynb- Interactive tutorial covering all featuresnotebooks/research_workflow.ipynb- Academic research workflow example
All examples use the built-in sample videos accessed via:
import musicalgestures as mg
# Access sample videos
dance_video = mg.examples.dance # Dancer video
pianist_video = mg.examples.pianist # Pianist videoEach example script can be run independently:
# Advanced video processing
python examples/advanced_video_processing.py
# Audio analysis
python examples/audio_analysis_example.py
# Batch processing
python examples/batch_processing_example.py
# Pose estimation
python examples/pose_estimation_example.pyFor Jupyter notebooks:
# Start Jupyter
jupyter notebook
# Open notebooks/comprehensive_tutorial.ipynb- Basic motion analysis
- Simple visualizations
- Audio waveforms and spectrograms
- Custom preprocessing
- Multiple analysis methods
- Parameter optimization
- Batch processing workflows
- Custom analysis pipelines
- Research-oriented analysis
- Using with other Python libraries
- Exporting data for external analysis
- Real-time processing concepts
Examples create output files in the same directory unless specified otherwise. Common outputs include:
*_motion.mp4- Motion detection videos*_average.png- Average images*_mgx.png,*_mgy.png- Motiongrams*_motion.csv- Motion data files*_spectrogram.png- Audio spectrograms
All examples are designed to be easily customized:
- Change input files - Replace sample videos with your own
- Modify parameters - Experiment with different settings
- Add analysis steps - Combine multiple analysis methods
- Custom output - Specify your own output directories
- Documentation: See the complete documentation
- Issues: Report problems on GitHub Issues
- Community: Join discussions in GitHub Discussions
Have a great example to share? We welcome contributions!
- Create a clear, well-documented example script
- Include comments explaining each step
- Test with the built-in sample videos
- Submit a pull request
See our Contributing Guide for details.