Cleanup in inference script, other minor changes

This commit is contained in:
N00MKRAD
2021-01-13 15:47:05 +01:00
parent 01a688512b
commit 561aca4eee
4 changed files with 37 additions and 97 deletions

View File

@@ -228,8 +228,11 @@ namespace Flowframes
{
UpdateOutputFPS();
int guiInterpFactor = interpFactorCombox.GetInt();
if (!Program.busy && guiInterpFactor > 2 && !GetAi().supportsAnyExp && Config.GetInt("autoEncMode") > 0)
Logger.Log($"Warning: {GetAi().aiName.Replace("_", "-")} doesn't natively support 4x/8x and will run multiple times for {guiInterpFactor}x. Auto-Encode will only work on the last run.");
if (!initialized)
return;
string aiName = GetAi().aiName.Replace("_", "-");
if (!Program.busy && guiInterpFactor > 2 && !GetAi().supportsAnyExp && Config.GetInt("autoEncMode") > 0 && !Logger.GetLastLine().Contains(aiName))
Logger.Log($"Warning: {aiName} doesn't natively support 4x/8x and will run multiple times for {guiInterpFactor}x. Auto-Encode will only work on the last run.");
}
public void SetWorking(bool state, bool allowCancel = true)

View File

@@ -95,6 +95,8 @@ namespace Flowframes
public static string GetLastLine ()
{
string[] lines = textbox.Text.SplitIntoLines();
if (lines.Length < 1)
return "";
return lines.Last();
}

View File

@@ -169,7 +169,7 @@ namespace Flowframes
string rifeDir = Path.Combine(Paths.GetPkgPath(), Path.GetFileNameWithoutExtension(Packages.rifeCuda.fileName));
string script = "inference_video.py";
string uhdStr = InterpolateUtils.UseUHD() ? "--UHD" : "";
string args = $" --img {framesPath.Wrap()} --exp {(int)Math.Log(interpFactor, 2)} {uhdStr} --imgformat {InterpolateUtils.GetOutExt()} --output {Paths.interpDir}";
string args = $" --input {framesPath.Wrap()} --exp {(int)Math.Log(interpFactor, 2)} {uhdStr} --imgformat {InterpolateUtils.GetOutExt()} --output {Paths.interpDir}";
if (!File.Exists(Path.Combine(rifeDir, script)))
{