mirror of
https://github.com/k4yt3x/video2x.git
synced 2026-02-16 18:54:42 +08:00
feat(realcugan): add support for Real-CUGAN ncnn Vulkan (#1268)
Signed-off-by: k4yt3x <i@k4yt3x.com>
This commit is contained in:
@@ -4,6 +4,7 @@
|
||||
#include <utility>
|
||||
|
||||
#include "filter_libplacebo.h"
|
||||
#include "filter_realcugan.h"
|
||||
#include "filter_realesrgan.h"
|
||||
#include "interpolator_rife.h"
|
||||
#include "logger_manager.h"
|
||||
@@ -95,6 +96,31 @@ void ProcessorFactory::init_default_processors(ProcessorFactory &factory) {
|
||||
}
|
||||
);
|
||||
|
||||
factory.register_processor(
|
||||
ProcessorType::RealCUGAN,
|
||||
[](const ProcessorConfig &proc_cfg,
|
||||
uint32_t vk_device_index) -> std::unique_ptr<Processor> {
|
||||
const auto &config = std::get<RealCUGANConfig>(proc_cfg.config);
|
||||
if (proc_cfg.scaling_factor <= 0) {
|
||||
logger()->critical("Scaling factor must be provided for the RealCUGAN filter");
|
||||
return nullptr;
|
||||
}
|
||||
if (config.model_name.empty()) {
|
||||
logger()->critical("Model name must be provided for the RealCUGAN filter");
|
||||
return nullptr;
|
||||
}
|
||||
return std::make_unique<FilterRealcugan>(
|
||||
static_cast<int>(vk_device_index),
|
||||
config.tta_mode,
|
||||
proc_cfg.scaling_factor,
|
||||
proc_cfg.noise_level,
|
||||
config.num_threads,
|
||||
config.syncgap,
|
||||
config.model_name
|
||||
);
|
||||
}
|
||||
);
|
||||
|
||||
factory.register_processor(
|
||||
ProcessorType::RIFE,
|
||||
[](const ProcessorConfig &proc_cfg,
|
||||
|
||||
Reference in New Issue
Block a user