Skip to content

Animatica is my diploma project that generates videos from text and images using neural networks. It automates animation creation with image generation, image-to-video conversion, and post-processing

License

Notifications You must be signed in to change notification settings

kefirchk/Animatica-ml-engine

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

51 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Animatica-ml-engine

Animatica is my diploma project that generates image animation from videos in real time or not using neural networks (FOMM). It automates animation creation with image generation, image-to-video conversion, and post-processing.

Deploying on Local

Setting up the environment

Step 1: Create a virtual environment

Linux/macOS:
python3 -m venv venv
source venv/bin/activate
Windows:
python -m venv venv
source venv/Scripts/activate

Step 2: Install requirements

cd app
pip install -r requirements.txt

Step 3: Create env files

# env/ml_engine.env
ML_ENGINE_KEY=your-secret-key
API_MODE=local
LOG_LEVEL=debug

Step 4: Preparing models

Download pretrained models and save them in folder named /app/data/checkpoints/.

Checkpoints can be found under following link: google-drive or yandex-disk.

Linux/macOS:
unzip checkpoints.zip
rm checkpoints.zip
Windows:

Unzip checkpoints.zip using unzipping software like 7zip.

Test ML Model

Step 1: Change directory

Go to app/src directory:

cd app/src

Step 2: Use cases

  1. Run the project from Jupyter Notebook named test.ipynb.

  2. Run the project using CLI (Command Line Interface).

    Examples:

    python run_model.py --mode train --configs config.yaml
    python run_model.py --mode reconstruction --configs config.yaml --checkpoint path/to/ckpt
    python run_model.py --mode animate --configs config.yaml --checkpoint path/to/ckpt

Test Server

Step 1: Change directory

Go to app directory:

cd app

Step 2: Run server

uvicorn src.run_server:app --host 0.0.0.0 --port 90 --reload 

Step 3: Use cases

Available endpoints:

Deploying via Docker

Docker container

Step 1: Change directory

Go to app directory:

cd app

Step 2: Build Image

docker build . --tag animatica-ml-engine

Step 3: Run container

docker run --name ml-engine -p 9080:90 animatica-ml-engine 

After, you can use the following endpoints:

Docker-compose

You can use Docker-compose with Animatica-backend.

My ready-made image: kefirchk/animatica-ml-engine:latest

System Design

system design

FOMM 1

FOMM 2

FOMM 3

Demo

demo 1
Real Time Demo


source image
Source Image


driving video
Driving Video


result
Animated Image (result)


TODO

  • Add pre-commit.
  • Add Docker.
  • Add GitHub Actions.
  • Optimize ML Model for CPU using.
  • Update the project with async operations.

About

Animatica is my diploma project that generates videos from text and images using neural networks. It automates animation creation with image generation, image-to-video conversion, and post-processing

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published