Total Pageviews

Monday, 8 August 2022

Anime4KCPP让你的低清小电影变成4K画质

 项目地址是https://github.com/TianZerL/Anime4KCPP

Anime4KCPP提供一个改进后的bloc97的Anime4K算法0.9版本,同时也提供自己的CNN算法ACNet。Anime4KCPP提供多种使用方式,包括预处理与实时播放,其致力于成为高性能的视频或图像处理工具。

  • 跨平台支持,已在Windows,Linux和macOS上通过编译测试。
  • 支持GPU加速,只需一块实现了OpenCL1.2或更高版本的GPU。
  • 高性能,低内存占用。
  • 支持多种使用方式。

使用方法

1.打开上方网址,下拉点击右侧releases,进入下载页面。

2.选择 “GUI”版本下载。只有这个版本才带有图形界面,更加易用。

Anime4KCPP 的 GUI 版本无需安装,解压后,点击目录中的 “Anime4KCPP_GUI.exe”即可运行。但在此之前,我们需要先配置 ffmpeg:

Anime4KCPP 的压缩视频功能需要用到 FFmpeg。FFmpeg 是一个视频处理的开源项目,市面上的大量播放器、转码工具乃至网页上的在线视频,很多都是基于 FFmpeg 的。点击下面链接进入 FFmpeg 官网,就可以下载到 Windows 平台的版本,是一个压缩包。

  • https://ffmpeg.org/

解压 FFmpeg 的压缩包,进入到其中的 “bin”目录,找到 “ffmpeg.exe”,将它复制到 Anime4KCPP 的根目录下即可。如果不做这一步,运行 Anime4KCPP 的时候可能会报错没有找到 FFmpeg。

将 "ffmpeg.exe" 复制过来,然后运行 “Anime4KCPP_GUI.exe”

接着,就可以开启 Anime4KCPP 使用了。Anime4KCPP 支持语种不少,但默认可能显示英文,这时候点击软件上方的 “Language”,即可切换语言。

 

可以这样参考设置。

切换回来 “主页”,这里可以设置放大后的视频的输出位置,以及处理后视频的文件名等等。直接将想要处理的视频拖入到软件,或者通过按钮开启目录打开文件,点击下面的 “开始处理”,Anime4KCPP 就会开始工作了。Anime4KCPP 支持视频或者图片,也就是说,如果你想要把低分辨率的图片放大到高清,也是可以做到的。

总之,是一款非常好用的开源应用。

------------------------------------------------------------------------------------------------

A high performance anime video upscaler.

Anime4KCPP
Latest GitHub release Platforms License

📄中文文档

📁Download

📖Wiki

About Anime4KCPP

Anime4KCPP provides an optimized bloc97's Anime4K algorithm version 0.9, and it also provides its own CNN algorithm ACNet, it provides a variety of way to use, including preprocessing and real-time playback, it aims to be a high performance tools to process both image and video.
This project is for learning and the exploration task of algorithm course in SWJTU.

About Anime4K09

Anime4K is a simple high-quality anime upscale algorithm. The version 0.9 does not use any machine learning approaches, and can be very fast in real-time processing or pretreatment.

About ACNet

ACNet is a CNN based anime upscale algorithm. It aims to provide both high-quality and high-performance.
HDN mode can better denoise, HDN level is from 1 to 3, higher for better denoising but may cause blur and lack of detail.
for detail, see wiki page.

Why Anime4KCPP

  • Cross-platform, building have already tested in Windows ,Linux, and macOS (Thanks for NightMachinary).
  • GPU acceleration support with all GPUs that implemented OpenCL 1.2 or newer.
  • CUDA acceleration.
  • High performance and low memory usage.
  • Support multiple usage methods.

Usage method

  • CLI
  • GUI
  • DirectShow Filter (Windows only, for MPC-HC/BE, potplayer and other DirectShow based players)
  • AviSynthPlus plugin
  • VapourSynth plugin
  • Android APP
  • C API binding
  • Python API binding
  • GLSL shader(For MPV based players)

For more infomation on how to use them, see wiki.

Performance

Single image (RGB):

Processor Type Algorithm 1080p -> 4K 512p -> 1024p Benchmark score
AMD Ryzen 2600 CPU ACNet 0.630 s 0.025 s 17.0068
Nvidia GTX1660 Super GPU ACNet 0.067 s 0.005 s 250
AMD Ryzen 2500U CPU ACNet 1.304 s 0.049 s 7.59301
AMD Vega 8 GPU ACNet 0.141 s 0.010 s 105.263
Snapdragon 820 CPU ACNet 5.532 s 0.180 s 1.963480
Adreno 530 GPU ACNet 3.133 s 0.130 s 3.292723
Snapdragon 855 CPU ACNet 3.998 s 0.204 s * 3.732736
Adreno 640 GPU ACNet 1.611 s 0.060 s 6.389776
Intel Atom N2800 CPU ACNet 11.827 s 0.350 s 0.960984
Raspberry Pi Zero W CPU ACNet 114.94 s 3.312 s 0.101158

*Snapdragon 855 may use Cortex-A55 core under low loads, which may lead to its performance not as good as Snapdragon 820

Building

For information on how to compile Anime4KCPP, see wiki.

Related projects

pyanime4k

pyanime4k is an Anime4KCPP API binding in Python, easy and fast.

ACNetGLSL

ACNetGLSL is an ACNet (Anime4KCPP Net) re-implemented in GLSL for real-time anime upscaling.

Projects that use Anime4KCPP

Credits

from  https://github.com/TianZerL/Anime4KCPP

------------------------------------------------------------------

A High-Quality Real Time Upscaler for Anime Video

bloc97.github.io/Anime4K/ 

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 anime4k.upscale@gmail.com 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:

  • A complete overhaul of the algorithm(s) for speed, quality and efficiency.
  • Real-time, high quality line art CNN upscalers. (6 variants)
  • Line art deblurring shaders. ("blind deconvolution" and DTD shader)
  • Denoising algorithms. (Bilateral Mode and CNN variants)
  • Blind resampling artifact reduction algorithms. (For badly resampled anime.)
  • Experimental line darkening and line thinning algorithm. (For perceptual quality. We perceive thinner/darker lines as perceptually higher quality, even if it might not be the case.)

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.

from https://github.com/bloc97/Anime4K

 

 

 

 

 

No comments:

Post a Comment