better implementation that works for all three AIs

This commit is contained in:
Richard
2021-02-11 12:33:09 +01:00
parent 68ffe9e682
commit 62b7650e69
2 changed files with 6 additions and 21 deletions

View File

@@ -96,25 +96,10 @@ namespace Flowframes.Main
public static void UpdateLastFrameFromInterpOutput(string output)
{
switch (AiProcess.currentAiName)
{
case "RIFE-CUDA":
{
Regex frameRegex = new Regex($@"(?<=> )\d*(?=.{GetOutExt()})");
if (!frameRegex.IsMatch(output)) return;
lastFrame = int.Parse(frameRegex.Match(output).Value);
break;
}
case "RIFE-NCNN":
{
break;
}
case "DAIN":
{
break;
}
default: return;
}
string dainStr = AiProcess.currentAiName == "DAIN" ? " done" : "";
Regex frameRegex = new Regex($@"(?<=.)\d*(?=.{GetOutExt()}{dainStr})");
if (!frameRegex.IsMatch(output)) return;
lastFrame = Math.Max(int.Parse(frameRegex.Match(output).Value), lastFrame);
}
public static int interpolatedInputFramesCount;

View File

@@ -93,7 +93,7 @@ namespace Flowframes
if(Interpolate.currentlyUsingAutoEnc) // Ensure AutoEnc is not paused
AutoEncode.paused = false;
currentAiName = "RIFE-CUDA";
currentAiName = "RIFE";
string rifeDir = Path.Combine(Paths.GetPkgPath(), Path.GetFileNameWithoutExtension(Packages.rifeCuda.fileName));
string script = "rife.py";
@@ -154,7 +154,7 @@ namespace Flowframes
processTimeMulti.Restart();
Logger.Log($"Running RIFE{(await InterpolateUtils.UseUHD() ? " (UHD Mode)" : "")}...", false);
currentAiName = "RIFE-NCNN";
currentAiName = "RIFE";
await RunRifeNcnnMulti(framesPath, outPath, factor, mdl);