๐ APISR: Anime Production Inspired Real-World Anime Super-Resolution
APISR aims at restoring and enhancing low-quality anime images and video sources with various degradations from real-world scenarios.
๐Visualization | ๐ฅ Update | ๐ง Installation | โกInference | ๐งฉ Dataset Curation | ๐ป Train
โญ If you like APISR, please help star this repo. Thanks! ๐ค
- Release Paper version implementation of APISR
- Release a version of weight (for 2x, 4x and more) that is more emphasized on user visual preference instead of metrics
- Gradio demo (maybe online)
git clone [email protected]:Kiteretsu77/APISR.git
cd APISR
# Create conda env
conda create -n APISR python=3.10
conda activate APISR
# Install Pytorch we use torch.compile in our repository by default
pip install torch==2.1.1 torchvision==0.16.1 torchaudio==2.1.1 --index-url https://download.pytorch.org/whl/cu118
pip install -r requirements.txt
# Install FFMPEG (the following is for linux system, the rest can see https://ffmpeg.org/download.html)
sudo apt install ffmpeg
- Download the weight from https://drive.google.com/file/d/1Ubj-1f7gmi-dWlK_aUVcScZAlzKtuBJ8/view?usp=sharing and put it to "pretrained" folder
- Then, Execute
The default argument of test_code/inference.py is capable to execute sample images from "assets" folder
python test_code/inference.py --input_dir XXX --weight_path XXX --store_dir XXX
-
All the dataset curation pipeline is under "dataset_curation_pipeline" folder. You can collect your own dataset by sending videos into the pipeline and get least compressed and the most informative images from the video sources. With a folder with video sources, you can execute the following to get a basic dataset:
python dataset_curation_pipeline/collect.py --video_folder_dir XXXX --save_dir XXX
-
Prepare a dataset (AVC/API)
-
Train: Please check opt.py to setup parameters you want (We use opt.py to control everything we want)
Step1 (Net L1 loss training): Runpython train_code/train.py
The model weights will be inside the folder 'saved_models'
Step2 (GAN Adversarial Training):
- Change opt['architecture'] in opt.py as "GRLGAN".
- Rename weights in 'saved_models' (either closest or the best, we use closest weight) to grlgan_pretrained.pth
- Run
python train_code/train.py --use_pretrained
- Fast Anime SR acceleration: https://github.com/Kiteretsu77/FAST_Anime_VSR
- My previous paper (VCISR - WACV2024) as the baseline method: https://github.com/Kiteretsu77/VCISR-official
Please cite us if our work is useful for your research.
This project is released for academic use only. We disclaim responsibility for the distribution of the dataset. Users are solely liable for their actions. The project contributors are not legally affiliated with, nor accountable for, users' behaviors.
This project is released under the GPL 3.0 license.
If you have any questions, please feel free to contact me at [email protected] or [email protected].