Anime4KCPP: entry-level image super-resolution algorithm tool

Anime4KCPP:入门级图像超分辨率算法工具

basic introduction

https://github.com/TianZerL/Anime4KCPP

About Anime4KCPP

Anime4KCPP provides an improved version 0.9 of the Anime4K algorithm of bloc97, and also provides its own CNN algorithm ACNet. Anime4KCPP provides a variety of usage methods, including pre-processing and real-time playback, and is committed to becoming a high-performance video or image processing tool. [Note that this algorithm version may not be as good as the latest Anime4K, after all, that thing is 4.0, but it seems that there is no way to find the tool directly exported through Anime4K in WIN]

About the Anime4K09 algorithm

The Anime4K algorithm is a simple and high-quality super-resolution algorithm for anime images. It does not use machine learning, so it is very fast and can be used for real-time processing and preprocessing. [So memory, video memory, etc. occupy low, and support CPU, GPU codec]

About ACNet

ACNet is a convolutional neural network-based super-resolution algorithm designed to provide both high quality and high performance. HDN mode can better noise reduction, HDN level from 1 to 3, the higher the noise reduction effect, the better, but it may cause blur and lack of detail.

Why choose Anime4KCPP

Cross-platform support, compiled and tested on Windows, Linux and macOS (thanks to NightMachinary). Support GPU acceleration, only need a GPU that implements OpenCL1.2 or higher version. CUDA acceleration is also supported. High performance, low memory usage. Supports multiple ways of use.

similar product

Such as Real-CUGAN, Waifu2x, Topaz Video AI, etc.

demo

Just download the released version directly at https://github.com/TianZerL/Anime4KCPP/releases . For example, win directly runs Anime4KCPP_GUI.exe

QQ%E5%9B%BE%E7%89%8720230123104144.pngQQ%E5%9B%BE%E7%89%8720230123104206.png

QQ%E5%9B%BE%E7%89%8720230123104934.pngQQ%E5%9B%BE%E7%89%8720230123104225.png

QQ%E5%9B%BE%E7%89%8720230123105017.png

Experimental test

Original video, 107MB, resolution 960×540, bit rate 0.5M, 24FPS, h264.avc encoding

Test1, Anime4KCPP mode, processing times 2, maximum refinement times 3, refinement intensity 0.6, processing intensity 1, magnification 2, threads 99, avc1, 24fps, GPU acceleration-CUDA, time-consuming 408s, 1.46G, 1080P, code Rate 8.7M

Test2, Anime4KCPP mode, processing times 2, maximum refinement times 3, refinement intensity 0.6, processing intensity 1, magnification 2, threads 99, avc1, 24fps, GPU acceleration-OpenCL, time-consuming 408s, 1.48G, 1080P, code Rate 8.8M

Through Test1 and Test2, it is found that there is no obvious difference between CUDA and OpenCL acceleration modes, and the speed is almost the same. OpenCL is slightly larger in file size and bit rate, and there is no difference in image quality.

Test3, Anime4KCPP mode, processing times 2, maximum number of thinning times 3, thinning strength 0.6, processing strength 1, magnification 2, thread 99, hevc, 24fps, GPU acceleration-CUDA, time-consuming 192s, export file invisible, obviously This mode is problematic and unavailable.

According to the document, it is mentioned in https://ift.tt/X2nHfFx [Note that the original video recommends H264.AVC encoding]

mp4v (fastest, default and recommended)

dxva(only for Windows, Hardware acceleration)

avc1(H264)

vp09(very slow)

hevc (not supported in Windows)

av01(not support in Windows)

1. In the Windows environment, hevc and av01 are not currently supported

2. As for the difference between mp4v and avc1, please refer to https://ift.tt/04YVtGR. In fact, they are all H264, but the encapsulation format is different.

AVC1 description: H.264 bitstream without start codes. Generally, the video generated by ffmpeg transcoding does not have the start code 0×00000001.

H264 Description: H.264 bitstream with start codes. Generally, for the compression format of movies such as HDDVD, it has the start code 0×00000001.

3. The vp09 labeling is very slow, compared to the fact that it does not support hardware encoding, and the problem of software encoding

4, dxva marked only supports windows but supports hardware acceleration

Test4, Anime4KCPP mode, processing times 2, maximum refinement times 3, refinement intensity 0.6, processing intensity 1, magnification 2, threads 99, dxva, 24fps, GPU acceleration-CUDA, time-consuming 197s-255s, size 3.52G, Code rate 21M

GPU and CPU usage becomes stable, unlike AVC1, which jumps up and down. At the same time, encoding takes up about 12%, 3D performance is about 80%, and CPU is about 50%. However, after encoding, there are a lot of hard disk writes, which are limited by hard disk performance. , the last time ran to 255s, and the actual output of this mode is indeed the H264.AVC encoding format

ffmpeg -y -hide_banner -hwaccel cuda -hwaccel_output_format cuda -c:v h264_cuvid -i “F:\FFOutput\Test3_AGE.mp4” -c:a copy -c:v hevc_nvenc -qp 22 “F:\FFOutput\Test4_AGE-qp22 .mp4”

ffmpeg -y -hide_banner -hwaccel cuda -hwaccel_output_format cuda -c:v h264_cuvid -i “F:\FFOutput\Test3_AGE.mp4” -c:a copy -c:v hevc_nvenc -qp 25 “F:\FFOutput\Test4_AGE-qp25 .mp4”

After using qp22 and 25 to compress to hevc encoding, the code rate of qp22 is 1.3M and the size is 251M, and the code rate of qp25 is 0.9M and the size is 177M. It is estimated that it is a good choice to compress to qp22 after using dxva.

Test5, Anime4KCPP mode, processing times 2, maximum refinement times 3, refinement intensity 0.6, processing intensity 1, magnification 2, threads 99, mp4v, 24fps, GPU acceleration-CUDA, time-consuming 328s, size 847M, code rate 4.8 m

Test6, Anime4KCPP mode, processing times 2, maximum number of thinning times 3, thinning strength 0.8, processing strength 1, magnification 2, thread 99, dxva, 24fps, fast mode, GPU acceleration-CUDA, time-consuming 191s-245s, size 3.55G, code rate 21M

The speed increase is very small and not particularly obvious. I don’t know if it will affect the quality. If it affects the quality, it is best not to open it.

Test7, Anime4KCPP mode, processing times 2, refinement maximum times 3, refinement intensity 0.8, processing intensity 1, magnification 2, thread 99, dxva, 24fps, transparent channel, GPU acceleration-CUDA, time-consuming 193s-251s, size 3.55G, code rate 21M

It seems that the transparent channel has no effect on the time, and there is no difference in the bit rate or anything. If there is no difference, there is no need to open it.

Test8, Anime4KCPP mode, processing times 2, maximum refinement times 3, refinement intensity 0.8, processing intensity 1, magnification 2, thread 10, dxva, 24fps, GPU acceleration-CUDA, time-consuming 235s, size 3.55G, code rate 21M

There is no difference between threads 10 and 99, and it may be useless if there are more threads, and even thread 99 is weaker.

Test9, Anime4KCPP mode, processing times 3, maximum refinement times 4, refinement intensity 0.8, processing intensity 1, magnification 2, thread 5, dxva, 24fps, GPU acceleration-CUDA, time-consuming 222s, size 3.67G, code rate 22M

Test10, Anime4KCPP mode, processing times 3, maximum refinement times 4, refinement intensity 0.2, processing intensity 1, magnification 2, threads 10, dxva, 24fps, GPU acceleration-CUDA, time-consuming 251s, size 3.58G, code rate 21M

Test11, Anime4KCPP mode, processing times 3, refinement maximum times 4, refinement strength 0.8, processing strength 1, magnification 2, threads 24, dxva, 24fps, GPU acceleration-CUDA, preprocessing CAS, postprocessing weak Gaussian + bilateral Filtering, time-consuming 1112s, size 3.46G, code rate 20M

Test12, ACNET mode, magnification 2, thread 24, dxva, 24fps, GPU acceleration-CUDA, time-consuming 225s, size 3.05G, code rate 18M

The CPU takes off directly at full load, but sometimes it is adjusted to 55%, and the GPU is about 75%. Note that this thing will make the memory take off

After some experience, the effect of ACNET is better than that of Anime4K (of course, it may also be a configuration and algorithm model problem)

Note that through the test, it is found that a large increase in the number of processing and refinement at the same time will affect the picture (distortion)

This article is transferred from https://www.blueskyxn.com/202301/6826.html
This site is only for collection, and the copyright belongs to the original author.