From f0f3166d927dcbf28aa3f86825029cfcc979d3c3 Mon Sep 17 00:00:00 2001 From: k4yt3x Date: Sat, 26 Oct 2024 00:00:00 +0000 Subject: [PATCH] chore(models): moved model files into subdirectories Signed-off-by: k4yt3x --- models/{ => libplacebo}/anime4k-mode-a.glsl | 0 models/{ => realesrgan}/realesr-animevideov3-x2.bin | Bin .../{ => realesrgan}/realesr-animevideov3-x2.param | 0 models/{ => realesrgan}/realesr-animevideov3-x3.bin | Bin .../{ => realesrgan}/realesr-animevideov3-x3.param | 0 models/{ => realesrgan}/realesr-animevideov3-x4.bin | Bin .../{ => realesrgan}/realesr-animevideov3-x4.param | 0 .../{ => realesrgan}/realesrgan-plus-anime-x4.bin | Bin .../{ => realesrgan}/realesrgan-plus-anime-x4.param | 0 models/{ => realesrgan}/realesrgan-plus-x4.bin | Bin models/{ => realesrgan}/realesrgan-plus-x4.param | 0 src/libplacebo_filter.cpp | 5 +++-- src/realesrgan_filter.cpp | 4 ++-- 13 files changed, 5 insertions(+), 4 deletions(-) rename models/{ => libplacebo}/anime4k-mode-a.glsl (100%) rename models/{ => realesrgan}/realesr-animevideov3-x2.bin (100%) rename models/{ => realesrgan}/realesr-animevideov3-x2.param (100%) rename models/{ => realesrgan}/realesr-animevideov3-x3.bin (100%) rename models/{ => realesrgan}/realesr-animevideov3-x3.param (100%) rename models/{ => realesrgan}/realesr-animevideov3-x4.bin (100%) rename models/{ => realesrgan}/realesr-animevideov3-x4.param (100%) rename models/{ => realesrgan}/realesrgan-plus-anime-x4.bin (100%) rename models/{ => realesrgan}/realesrgan-plus-anime-x4.param (100%) rename models/{ => realesrgan}/realesrgan-plus-x4.bin (100%) rename models/{ => realesrgan}/realesrgan-plus-x4.param (100%) diff --git a/models/anime4k-mode-a.glsl b/models/libplacebo/anime4k-mode-a.glsl similarity index 100% rename from models/anime4k-mode-a.glsl rename to models/libplacebo/anime4k-mode-a.glsl diff --git a/models/realesr-animevideov3-x2.bin b/models/realesrgan/realesr-animevideov3-x2.bin similarity index 100% rename from models/realesr-animevideov3-x2.bin rename to models/realesrgan/realesr-animevideov3-x2.bin diff --git a/models/realesr-animevideov3-x2.param b/models/realesrgan/realesr-animevideov3-x2.param similarity index 100% rename from models/realesr-animevideov3-x2.param rename to models/realesrgan/realesr-animevideov3-x2.param diff --git a/models/realesr-animevideov3-x3.bin b/models/realesrgan/realesr-animevideov3-x3.bin similarity index 100% rename from models/realesr-animevideov3-x3.bin rename to models/realesrgan/realesr-animevideov3-x3.bin diff --git a/models/realesr-animevideov3-x3.param b/models/realesrgan/realesr-animevideov3-x3.param similarity index 100% rename from models/realesr-animevideov3-x3.param rename to models/realesrgan/realesr-animevideov3-x3.param diff --git a/models/realesr-animevideov3-x4.bin b/models/realesrgan/realesr-animevideov3-x4.bin similarity index 100% rename from models/realesr-animevideov3-x4.bin rename to models/realesrgan/realesr-animevideov3-x4.bin diff --git a/models/realesr-animevideov3-x4.param b/models/realesrgan/realesr-animevideov3-x4.param similarity index 100% rename from models/realesr-animevideov3-x4.param rename to models/realesrgan/realesr-animevideov3-x4.param diff --git a/models/realesrgan-plus-anime-x4.bin b/models/realesrgan/realesrgan-plus-anime-x4.bin similarity index 100% rename from models/realesrgan-plus-anime-x4.bin rename to models/realesrgan/realesrgan-plus-anime-x4.bin diff --git a/models/realesrgan-plus-anime-x4.param b/models/realesrgan/realesrgan-plus-anime-x4.param similarity index 100% rename from models/realesrgan-plus-anime-x4.param rename to models/realesrgan/realesrgan-plus-anime-x4.param diff --git a/models/realesrgan-plus-x4.bin b/models/realesrgan/realesrgan-plus-x4.bin similarity index 100% rename from models/realesrgan-plus-x4.bin rename to models/realesrgan/realesrgan-plus-x4.bin diff --git a/models/realesrgan-plus-x4.param b/models/realesrgan/realesrgan-plus-x4.param similarity index 100% rename from models/realesrgan-plus-x4.param rename to models/realesrgan/realesrgan-plus-x4.param diff --git a/src/libplacebo_filter.cpp b/src/libplacebo_filter.cpp index dd44b85..86918fc 100644 --- a/src/libplacebo_filter.cpp +++ b/src/libplacebo_filter.cpp @@ -42,8 +42,9 @@ int LibplaceboFilter::init(AVCodecContext *dec_ctx, AVCodecContext *enc_ctx, AVB shader_full_path = shader_path; } else { // Construct the fallback path using std::filesystem - shader_full_path = - find_resource_file(std::filesystem::path("models") / (shader_path.string() + ".glsl")); + shader_full_path = find_resource_file( + std::filesystem::path("models") / "libplacebo" / (shader_path.string() + ".glsl") + ); } // Check if the shader file exists diff --git a/src/realesrgan_filter.cpp b/src/realesrgan_filter.cpp index fbe35ce..44eb477 100644 --- a/src/realesrgan_filter.cpp +++ b/src/realesrgan_filter.cpp @@ -39,9 +39,9 @@ int RealesrganFilter::init(AVCodecContext *dec_ctx, AVCodecContext *enc_ctx, AVB if (model) { // Find the model paths by model name if provided - model_param_path = std::filesystem::path("models") / + model_param_path = std::filesystem::path("models") / "realesrgan" / (std::string(model) + "-x" + std::to_string(scaling_factor) + ".param"); - model_bin_path = std::filesystem::path("models") / + model_bin_path = std::filesystem::path("models") / "realesrgan" / (std::string(model) + "-x" + std::to_string(scaling_factor) + ".bin"); } else if (!custom_model_param_path.empty() && !custom_model_bin_path.empty()) { // Use the custom model paths if provided