Skip to content

Daniyal117/-Anime-Style-Transformer

Repository files navigation

Anime Style Transformer

Transform your images into stunning anime-style artwork with our production-ready API service. Built with FastAPI and powered by advanced deep learning models.

Overview

This project implements a production-ready API service for the Scenimefy model, which transforms regular images into anime-style artwork. The implementation includes:

  • FastAPI endpoint for image processing
  • Celery backend for asynchronous task processing
  • Efficient image transformation pipeline
  • Production-ready deployment setup

Technical Implementation

The API service is built using:

  • FastAPI for the REST API
  • Celery for background task processing
  • PyTorch for model inference
  • PIL for image processing

Model Architecture

This implementation is based on the Scenimefy model, which combines elements from:

  • Contrastive Learning for Unpaired Image-to-Image Translation (ECCV 2020)
  • StyleGAN2 architecture
  • ResNet-based generator architecture

Demo Results

📸 Demo Results

Below are the side-by-side comparisons of the original and their anime-stylized versions.


🎨 Example 1: Portrait Transformation

Original Anime Style

🎬 Example 2: Movie Poster Transformation

Original Anime Style

🧑‍🎤 Example 3: Character Transformation

Original Anime Style

🧨 Example 4: Action Scene Transformation

Original Anime Style

🕷️ Example 5: Superhero Transformation

Original Anime Style

Setup and Installation

  1. Clone the repository
  2. Install dependencies:
pip install -r requirements.txt
  1. Start the FastAPI server:
uvicorn api:app --reload
  1. Start Celery worker:
celery -A tasks worker --loglevel=info

API Usage

Send a POST request to /stylize endpoint with an image file:

import requests

url = "http://localhost:8000/stylize"
files = {"file": open("image.jpg", "rb")}
response = requests.post(url, files=files)

License

This project is for demonstration purposes only. The underlying model architecture is based on academic research and open-source implementations.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages