From 0ad4d4771d67fce8124d22c8abf163a1812c008d Mon Sep 17 00:00:00 2001 From: GenZmeY Date: Mon, 2 Nov 2020 20:54:02 +0300 Subject: [PATCH] feat: auto-range system --- scripts/ranges.sh | 7 ++----- settings/range-gen.conf | 3 +++ video2d-2x | 1 + 3 files changed, 6 insertions(+), 5 deletions(-) create mode 100644 settings/range-gen.conf diff --git a/scripts/ranges.sh b/scripts/ranges.sh index 44a92f1..9c877be 100644 --- a/scripts/ranges.sh +++ b/scripts/ranges.sh @@ -28,9 +28,6 @@ function add_range () # $1: Start frame, $2: End frame, $3: Noise level echo -e "$1\t$2\t$3" >> "$RangesList" } -StartFrame=$(ls "$FramesDir" | sort | head -n 1 | sed 's|.png$||') -EndFrame=$(ls "$FramesDir" | sort | tail -n 1 | sed 's|.png$||') -NoiseLevel="1" +source "$RangeGenConf" -:> "$RangesList" -add_range "$StartFrame" "$EndFrame" "$NoiseLevel" +"$DepsDir/range-gen/range-gen.exe" -j "$Jobs" -n "$NoiseLevel" "$FramesDir" "$RangesList" "$Threshold" diff --git a/settings/range-gen.conf b/settings/range-gen.conf new file mode 100644 index 0000000..37a0ee2 --- /dev/null +++ b/settings/range-gen.conf @@ -0,0 +1,3 @@ +Jobs="$(nproc)" +Threshold="365" +NoiseLevel="1" diff --git a/video2d-2x b/video2d-2x index d3d4eb9..88942c5 100644 --- a/video2d-2x +++ b/video2d-2x @@ -48,6 +48,7 @@ readonly RangesList="$OutputDir/ranges.list" readonly Video2d2xConf="$SettingsDir/video2d-2x.conf" readonly Waifu2xConf="$SettingsDir/waifu2x-caffe.conf" readonly FfmpegConf="$SettingsDir/ffmpeg.conf" +readonly RangeGenConf="$SettingsDir/range-gen.conf" source "$ScriptsDir/returncodes.lib" source "$ScriptsDir/common.lib"