Skip to content

This application allows you to generate mathematical animations using natural language descriptions. It uses OpenAI's GPT model to convert your descriptions into Manim code, which is then used to create beautiful mathematical animations.

License

Notifications You must be signed in to change notification settings

rohitg00/manim-video-generator

 
 

Repository files navigation

Manim Video Generator

This application allows you to generate mathematical animations using natural language descriptions. It uses OpenAI's GPT model to convert your descriptions into Manim code, which is then used to create beautiful mathematical animations.

Prerequisites

  • Python 3.7+
  • FFmpeg
  • LaTeX distribution (for rendering mathematical equations)
  • OpenAI API key

Installation

  1. Clone this repository:
git clone https://github.com/rohitg00/manim-video-generator.git
cd manim-video-generator
  1. Install the required dependencies:
pip install -r requirements.txt
  1. Install Manim system dependencies:
# For macOS
brew install cairo ffmpeg
  1. Set up your environment variables:
cp .env.example .env

Then edit .env and add your OpenAI API key.

Usage

  1. Start the Flask application:
python app.py
  1. Open your web browser and navigate to http://localhost:5000

  2. Enter a description of the mathematical animation you want to create in the text area

  3. Click "Generate Video" and wait for your animation to be created

Examples

Here are some example prompts you can try:

  • "Create an animation showing a circle transforming into a square"
  • "Show the unit circle with sine and cosine waves being traced out"
  • "Demonstrate the Pythagorean theorem with animated squares on triangle sides"

How it Works

  1. The application takes your natural language description and sends it to OpenAI's GPT model
  2. GPT generates the appropriate Manim code for your animation
  3. The code is executed using Manim to create an MP4 video
  4. The video is served back to your browser

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

This project is licensed under the MIT License - see the LICENSE file for details.

About

This application allows you to generate mathematical animations using natural language descriptions. It uses OpenAI's GPT model to convert your descriptions into Manim code, which is then used to create beautiful mathematical animations.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published