added RealCUGAN

This commit is contained in:
k4yt3x
2022-03-19 17:45:03 +00:00
parent fa3bd38217
commit 625b340f3d
4 changed files with 96 additions and 75 deletions

View File

@@ -19,7 +19,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
Name: Upscaler
Author: K4YT3X
Date Created: May 27, 2021
Last Modified: February 16, 2022
Last Modified: March 19, 2022
"""
import math
@@ -32,9 +32,10 @@ import time
from loguru import logger
from PIL import Image, ImageChops, ImageStat
from realsr_ncnn_vulkan_python.realsr_ncnn_vulkan import Realsr
from srmd_ncnn_vulkan_python.srmd_ncnn_vulkan import Srmd
from waifu2x_ncnn_vulkan_python.waifu2x_ncnn_vulkan import Waifu2x
from realcugan_ncnn_vulkan_python import Realcugan
from realsr_ncnn_vulkan_python import Realsr
from srmd_ncnn_vulkan_python import Srmd
from waifu2x_ncnn_vulkan_python import Waifu2x
# fixed scaling ratios supported by the algorithms
# that only support certain fixed scale ratios
@@ -42,9 +43,15 @@ ALGORITHM_FIXED_SCALING_RATIOS = {
"waifu2x": [1, 2],
"srmd": [2, 3, 4],
"realsr": [4],
"realcugan": [1, 2, 3, 4],
}
ALGORITHM_CLASSES = {"waifu2x": Waifu2x, "srmd": Srmd, "realsr": Realsr}
ALGORITHM_CLASSES = {
"waifu2x": Waifu2x,
"srmd": Srmd,
"realsr": Realsr,
"realcugan": Realcugan,
}
class Upscaler(multiprocessing.Process):
@@ -164,7 +171,7 @@ class Upscaler(multiprocessing.Process):
processor_object = processor_objects.get((algorithm, job))
if processor_object is None:
processor_object = ALGORITHM_CLASSES[algorithm](
scale=job, noise=noise
noise=noise, scale=job
)
processor_objects[(algorithm, job)] = processor_object

View File

@@ -27,7 +27,7 @@ __ __ _ _ ___ __ __
Name: Video2X
Creator: K4YT3X
Date Created: February 24, 2018
Last Modified: March 18, 2022
Last Modified: March 19, 2022
Editor: BrianPetkovsek
Last Modified: June 17, 2019
@@ -82,6 +82,7 @@ UPSCALING_ALGORITHMS = [
"waifu2x",
"srmd",
"realsr",
"realcugan",
]
# algorithms available for frame interpolation tasks