mirror of
https://github.com/n00mkrad/flowframes.git
synced 2025-12-16 16:37:48 +01:00
Lock pre-4.0 rife ncnn models to 2x
This commit is contained in:
@@ -135,7 +135,7 @@ namespace Flowframes.IO
|
|||||||
public static async Task DownloadModelFiles (AI ai, string modelDir, bool log = true)
|
public static async Task DownloadModelFiles (AI ai, string modelDir, bool log = true)
|
||||||
{
|
{
|
||||||
string aiDir = ai.pkgDir;
|
string aiDir = ai.pkgDir;
|
||||||
Logger.Log($"DownloadModelFiles(string ai = {ai}, string model = {modelDir}, bool log = {log})", true);
|
Logger.Log($"DownloadModelFiles(string ai = {ai.aiName}, string model = {modelDir}, bool log = {log})", true);
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -272,11 +272,12 @@ namespace Flowframes.Os
|
|||||||
SetProgressCheck(outPath, factor);
|
SetProgressCheck(outPath, factor);
|
||||||
int targetFrames = ((IoUtils.GetAmountOfFiles(lastInPath, false, "*.*") * factor).RoundToInt()); // TODO: Maybe won't work with fractional factors ??
|
int targetFrames = ((IoUtils.GetAmountOfFiles(lastInPath, false, "*.*") * factor).RoundToInt()); // TODO: Maybe won't work with fractional factors ??
|
||||||
|
|
||||||
|
string frames = mdl.Contains("v4") ? $"-n {targetFrames}" : "";
|
||||||
string uhdStr = await InterpolateUtils.UseUhd() ? "-u" : "";
|
string uhdStr = await InterpolateUtils.UseUhd() ? "-u" : "";
|
||||||
string ttaStr = Config.GetBool(Config.Key.rifeNcnnUseTta, false) ? "-x" : "";
|
string ttaStr = Config.GetBool(Config.Key.rifeNcnnUseTta, false) ? "-x" : "";
|
||||||
|
|
||||||
rifeNcnn.StartInfo.Arguments = $"{OsUtils.GetCmdArg()} cd /D {Path.Combine(Paths.GetPkgPath(), Implementations.rifeNcnn.pkgDir).Wrap()} & rife-ncnn-vulkan.exe " +
|
rifeNcnn.StartInfo.Arguments = $"{OsUtils.GetCmdArg()} cd /D {Path.Combine(Paths.GetPkgPath(), Implementations.rifeNcnn.pkgDir).Wrap()} & rife-ncnn-vulkan.exe " +
|
||||||
$" -v -i {inPath.Wrap()} -o {outPath.Wrap()} -n {targetFrames} -m {mdl.ToLower()} {ttaStr} {uhdStr} -g {Config.Get(Config.Key.ncnnGpus)} -f {GetNcnnPattern()} -j {GetNcnnThreads()}";
|
$" -v -i {inPath.Wrap()} -o {outPath.Wrap()} {frames} -m {mdl.ToLower()} {ttaStr} {uhdStr} -g {Config.Get(Config.Key.ncnnGpus)} -f {GetNcnnPattern()} -j {GetNcnnThreads()}";
|
||||||
|
|
||||||
Logger.Log("cmd.exe " + rifeNcnn.StartInfo.Arguments, true);
|
Logger.Log("cmd.exe " + rifeNcnn.StartInfo.Arguments, true);
|
||||||
|
|
||||||
|
|||||||
@@ -157,7 +157,15 @@ namespace Flowframes.Ui
|
|||||||
{
|
{
|
||||||
AI ai = Program.mainForm.GetAi();
|
AI ai = Program.mainForm.GetAi();
|
||||||
|
|
||||||
if(ai.factorSupport == AI.FactorSupport.Fixed)
|
if (ai.aiName == Implementations.rifeNcnn.aiName && !Program.mainForm.GetModel(ai).dir.Contains("v4"))
|
||||||
|
{
|
||||||
|
if (factor != 2)
|
||||||
|
Logger.Log($"{ai.friendlyName} models before 4.0 only support 2x interpolation!");
|
||||||
|
|
||||||
|
return 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (ai.factorSupport == AI.FactorSupport.Fixed)
|
||||||
{
|
{
|
||||||
int closest = ai.supportedFactors.Min(i => (Math.Abs(factor.RoundToInt() - i), i)).i;
|
int closest = ai.supportedFactors.Min(i => (Math.Abs(factor.RoundToInt() - i), i)).i;
|
||||||
return (float)closest;
|
return (float)closest;
|
||||||
|
|||||||
Reference in New Issue
Block a user