An automated system for generating educational ML concept animations from text descriptions using Manim.
Text input → ConceptParser → Scene Planner → Visual Mapper → Code Generator → Render + AI Critic → Final Animation
- ConceptParser: Identifies key entities (variance, principal components, data points, etc.)
- Scene Planner: Breaks concepts into structured scenes ("Data Intro", "PCA Transformation", etc.)
- Visual Mapper: Maps abstract concepts to concrete visual elements (arrows, surfaces, dots)
- Code Generator: Writes executable Manim scene code
- Render + AI Critic: Analyzes and improves timing, clarity, and educational value
- 🎓 Educational Focus: Optimized for learning with clear narration and pacing
- 🎨 Automatic Visualization: Converts text to 3D animations without manual design
- 🤖 AI-Powered Quality Control: Iterative improvement based on educational criteria
- 🔧 Extensible: Easy to add new ML concepts beyond PCA
- 📊 Comprehensive Analysis: Detailed reports on animation quality and suggestions
- 🎬 Automatic Rendering: Renders all scenes with Manim automatically
- 🎞️ Video Concatenation: Combines all scenes into a single final video
# Install Python dependencies
pip install -r requirements.txt
# Install ffmpeg (required for video concatenation)
# macOS:
brew install ffmpeg
# Ubuntu/Debian:
sudo apt-get install ffmpeg
# Windows: Download from https://ffmpeg.orgpython demo.pyThis generates a complete PCA explanation animation from text input.
from src.pipeline import VisualizationPipeline
pipeline = VisualizationPipeline()
result = pipeline.generate_visualization(
text_input="Your ML concept explanation here...",
topic="pca",
max_iterations=3
)The pipeline generates:
- Manim code: Executable Python files for animation
- Rendered videos: Individual scene animations in MP4 format
- Final video: Single concatenated video with all scenes
- Analysis reports: Detailed feedback on educational effectiveness
- Scene breakdowns: Structured visualization plans
Currently optimized for PCA (Principal Component Analysis):
- Data visualization in 3D space
- Variance and spread demonstration
- Principal component identification
- Dimensionality reduction projection
- Shadow/projection analogies
- Identifies mathematical entities, visual elements, and process steps
- Assigns importance scores and visual properties
- Maps relationships between concepts
- Creates educational narrative flow
- Optimizes timing and transitions
- Generates contextual narration
- Converts abstract concepts to 3D visual elements
- Plans camera movements and animations
- Manages color schemes and styling
- Produces clean, executable Manim code
- Handles 3D scene setup and animations
- Generates proper class structures
- Analyzes timing, visual clarity, and educational value
- Provides specific improvement suggestions
- Iteratively refines animations
ml-visualization/
├── src/
│ ├── concept_parser.py # Entity identification
│ ├── scene_planner.py # Scene structuring
│ ├── visual_mapper.py # Visual element mapping
│ ├── code_generator.py # Manim code generation
│ ├── ai_critic.py # Quality analysis
│ └── pipeline.py # Main orchestrator
├── demo.py # Demo script
├── requirements.txt # Dependencies
└── README.md # This file
To add support for new ML concepts:
- Extend
ConceptParserwith new entity mappings - Add scene templates in
ScenePlanner - Create visual mappings in
VisualMapper - Update educational criteria in
AICritic
MIT License - see LICENSE file for details.
v1.2.0 - Automatic Rendering & Video Concatenation (Oct 21, 2025)
- ✅ Added automatic rendering of all scenes with Manim
- ✅ Implemented video concatenation using ffmpeg
- ✅ Single final output video combining all scenes
- ✅ Graceful fallback when dependencies are missing
v1.1.0 - Fixed Indentation Issues (Oct 21, 2025)
- ✅ Fixed code generator indentation errors
- ✅ Improved textwrap usage for clean Manim code
- ✅ Enhanced numpy compatibility
- ✅ All generated code now properly formatted and runnable
See FIXES_APPLIED.md for detailed changelog.
Built by: Ramakrushna Mohapatra