Image to Anime
The goal of Image to Anime was to create a new version of the image that would possess the same clean lines and evoke the characteristic feel found in anime productions, capturing the unique artistry, and aesthetics associated with this style.
Image To Anime

Summary
Introduction
With a model called AnimeGANv2, it uses Generative Adversarial Networks (GAN) architecture to train and create high-quality anime images. GAN is a two-part network architecture consisting of a generator and a discriminator. The generator network aims to create anime images that resemble real images, while the discriminator network tries to distinguish between images generated from the generator network and real images.
Parameters
Inputs
input- (image - .png/.jpg/.jpeg): This is the type of realistic image that users need to convert.
Output
output- (image -.png): The image is recreated according to the user's request. The size of the image when reproduced will not change.
Examples
| Input | Output |
|---|---|
![]() | ![]() |
![]() | ![]() |
Usage for developers
Please find below the details to track the information and access the code for processing the model on our platform.
Requirements
pip install -r requirements.txt
Code based on AIOZ structure
from .model import Generator
import torch, os
import cv2
import numpy as np
...
def do_ai_task(
input: Union[str, Path],
model_storage_directory: Union[str, Path],
device: Literal["cpu", "cuda", "gpu"] = "cpu",
*args, **kwargs) -> Any:
"""Define AI task: load model, pre-process, post-process, etc ..."""
output_path = 'output.png'
# Load model
net = load_model(model_storage_directory, device)
# Pre-processing
input_img = preprocess(input, device)
# Inference
with torch.no_grad():
out = net(input_img, False)
out = out.squeeze(0).cpu()
out = ((out + 1.) * 127.5).numpy().clip(0, 255).astype(np.uint8)
out = cv2.cvtColor(out, cv2.COLOR_RGB2BGR)
cv2.imwrite(output_path, out)
# Return output
output = open(output_path, "rb") # io.BufferedReader
return output
Reference
This repository is based on and inspired by Bryand Lee's work. We sincerely appreciate their generosity in sharing the code.
License
We respect and comply with the terms of the author's license cited in the Reference section.



