Anime4K README

The project's README from github.com/bloc97/Anime4K. As one markdown file: README.md.

Anime4K

Anime4K is a set of open-source, high-quality real-time anime upscaling/denoising algorithms that can be implemented in any programming language.

The simplicity and speed of Anime4K allows the user to watch upscaled anime in real time, as we believe in preserving original content and promoting freedom of choice for all anime fans. Re-encoding anime into 4K should be avoided as it is non-reversible, potentially damages original content by introducing artifacts, takes up to O(n2) more disk space and more importantly, does so without any meaningful decrease in entropy (lost information is lost).

Disclaimer: All art assets used are for demonstration and educational purposes. All rights are reserved to their original owners. If you (as a person or a company) own the art and do not wish it to be associated with this project, please contact us at [email protected] and we will gladly take it down.

Foreword

Anime4K is optimized for native 1080p anime encoded with h.264, h.265 or VC-1.

Even if it might work, it is not optimized for downscaled 720p, 480p or standard definition anime (eg. DVDs). Older anime (especially pre-digital era production) have artifacts that are very difficult to remove, such as bad deinterlacing, camera blur during production, severe ringing, film grain, older MPEG compression artifacts, etc.

This is also not replacement for SRGANs, as they perform much better on low-resolution images or images with lots of degradation (albeit not in real time).

What Anime4K does provide is a way to upscale, in real time, 1080p anime for 4K screens while providing a similar effect to SRGANs and being much better than waifu2x (See comparisons).

Currently, research is being done on better real-time upscaling for lower resolution or older content.

Installation Instructions

Windows

Linux

Mac

v4.1 Low resolution experiment

Results from the experimental SRGAN shaders for 360p -> 4K: (zoom in to view details)

The images are sorted by algorithm speed, bicubic being the fastest. FSRCNNX and Anime4K are real-time while waifu2x and Real-ESRGAN are not. Comparison Comparison

v4

We introduce a line reconstruction algorithm that aims to tackle the distribution shift problem seen in 1080p anime. In the wild anime exhibit a surprising amount of variance caused by low quality compositing due to budget and time constraints that traditional super-resolution algorithms cannot handle. GANs can implicitly encode this distribution shift but are slow to use and hard to train. Our algorithm explicitly corrects this distribution shift and allows traditional "MSE" SR algorithms to work with a wide variety of anime.

Source: https://fancaps.net/anime/picture.php?/14728493 | Mode: B
Comparison

Source: https://fancaps.net/anime/picture.php?/13365760 | Mode: A
Comparison

Performance numbers are obtained using a Vega64 GPU and are tested using UL shader variants. The fast version is for M variants.
Note that CUDA accelerated SRGANs/Waifu2x using tensor cores can be much faster and close to realtime (~80ms), but their large size severely hampers non-CUDA implementations.

v3

The monolithic Anime4K shader is broken into modular components, allowing customization for specific types of anime and/or personal taste. What's new:

More information about each shader (OUTDATED).

Visits

Counting since 2021-09-19T16:02:06Z (ISO 8601)

Projects that use Anime4K

Note that the following might be using an outdated version of Anime4K. There have been significant quality improvements since v3.

Acknowledgements

OpenCV TensorFlow Keras Torch mpv MPC
OpenCV TensorFlow Keras Torch mpv MPC

Many thanks to the OpenCV, TensorFlow, Keras and Torch groups and contributors. This project would not have been possible without the existence of high quality, open source machine learning libraries.

I would also want to specially thank the creators of VDSR and FSRCNN, in addition to the open source projects waifu2x and FSRCNNX for sparking my interest in creating this project. I am also extending my gratitude to the contributors of mpv and MPC-HC/BE for their efforts on creating excellent media players with endless customization options.
Furthermore, I want to thank the people who contributed to this project in any form, be it by reporting bugs, submitting suggestions, helping others' issues or submitting code. I will forever hold you in high regard.

I also wish to express my sincere gratitude to the people of Université de Montréal, DIRO, LIGUM and MILA for providing so many opportunities to students (including me), providing the necessary infrastructure and fostering an excellent learning environment.

I would also like to thank the greater open source community, in which the assortment of concrete examples and code were of great help.

Finally, but not least, infinite thanks to my family, friends and professors for providing financial, technical, social support and expertise for my ongoing learning journey during these hard times. Your help has been beyond description, really.

This list is not final, as the project is far from done. Any future acknowledgements will be promptly added.

Anime4K (bloc97/Anime4K)

Searching Database…

21.5K ·GitHub
这是什么?Anime4K 是一组开源的实时放大和降噪算法,以 GLSL shader 的形式实现。它能在媒体播放器里即时锐化并放大动漫视频,而不需要把文件永久重新编码。
这是独立的应用程序,还是需要加载到播放器里使用的东西?它本身不是独立应用,而是一套 GLSL shader 库,需要加载到支持 shader 的媒体播放器中使用,例如 mpv、IINA、Plex。不过也有多个社区项目把它封装成了现成的图形界面应用。
我该怎么把它跑起来?按照你所用平台的安装指南操作:在 Windows 和 Linux 上,通过 GLSL/MPV 或 GLSL/Plex 加载 shader;在 Mac 上,还可以使用 GLSL/IINA。每份指南都会带你把播放器的 shader 处理流程指向 Anime4K 的 shader 文件。
我一定要用某个特定的播放器吗,还是随便什么视频播放器都行?一定要。Anime4K 是以 GLSL shader 实现的,所以你需要一个支持 GLSL shader 的播放器,例如 mpv、IINA 或 Plex。README 为每个播放器都提供了单独的设置指南。
它对所有动漫视频都效果好吗,有没有什么限制?它针对原生 1080p、使用 h.264、h.265 或 VC-1 编码的动漫做了调优。对于降采样的 720p/480p 或老旧的标清源,它并未做优化;压缩严重或带有大量模糊伪影的非常老的动漫,也很难清理干净。
要实时运行,是不是得有一块性能很强的显卡?是的,实时 shader 放大主要依赖显卡(GPU)。项目的基准测试是在 AMD Vega64 上完成的;项目也提到,CUDA 张量核心实现可能更快,但只能在 CUDA 环境下使用。
它和 waifu2x 或 Real-ESRGAN 这类 AI 放大工具相比如何?Anime4K 的设计目标是在播放时实时运行。而 waifu2x、Real-ESRGAN 这类基于 GAN 的放大工具,在处理严重退化或低分辨率的图像时效果更好,但速度太慢,无法实时使用。
v3 和 v4 版本的 shader 有什么变化?v3 把原来的单体 shader 拆分为模块化的线稿 CNN 放大、去模糊、降噪和重采样伪影处理等几个 shader;v4 新增了线条重建算法,专门用来修正真实世界中合成不一致的 1080p 动漫所出现的分布偏移问题。
有没有更简单的应用,不用手动配置 shader?有。社区基于 Anime4K 开发了多个现成工具,包括一款适用于 Windows 10/11 的图形界面放大工具、一款面向苹果平台的 Metal 应用,以及用 PyTorch、C#、Rust 和 C++ 重新实现的版本。
Creator
bloc97
Size
804.8 MB
Stars
21.5K
Age
7y
Commits · 90 Days