feat: auto-range system

This commit is contained in:
GenZmeY 2020-11-02 20:54:02 +03:00
parent ab46134e7b
commit 0ad4d4771d
3 changed files with 6 additions and 5 deletions

View File

@ -28,9 +28,6 @@ function add_range () # $1: Start frame, $2: End frame, $3: Noise level
echo -e "$1\t$2\t$3" >> "$RangesList" echo -e "$1\t$2\t$3" >> "$RangesList"
} }
StartFrame=$(ls "$FramesDir" | sort | head -n 1 | sed 's|.png$||') source "$RangeGenConf"
EndFrame=$(ls "$FramesDir" | sort | tail -n 1 | sed 's|.png$||')
NoiseLevel="1"
:> "$RangesList" "$DepsDir/range-gen/range-gen.exe" -j "$Jobs" -n "$NoiseLevel" "$FramesDir" "$RangesList" "$Threshold"
add_range "$StartFrame" "$EndFrame" "$NoiseLevel"

3
settings/range-gen.conf Normal file
View File

@ -0,0 +1,3 @@
Jobs="$(nproc)"
Threshold="365"
NoiseLevel="1"

View File

@ -48,6 +48,7 @@ readonly RangesList="$OutputDir/ranges.list"
readonly Video2d2xConf="$SettingsDir/video2d-2x.conf" readonly Video2d2xConf="$SettingsDir/video2d-2x.conf"
readonly Waifu2xConf="$SettingsDir/waifu2x-caffe.conf" readonly Waifu2xConf="$SettingsDir/waifu2x-caffe.conf"
readonly FfmpegConf="$SettingsDir/ffmpeg.conf" readonly FfmpegConf="$SettingsDir/ffmpeg.conf"
readonly RangeGenConf="$SettingsDir/range-gen.conf"
source "$ScriptsDir/returncodes.lib" source "$ScriptsDir/returncodes.lib"
source "$ScriptsDir/common.lib" source "$ScriptsDir/common.lib"