Fix DAIN-NCNN target frame count

This commit is contained in:
n00mkrad
2022-04-15 13:29:28 +02:00
parent 6e70d89cd5
commit 7a3c1c484c
3 changed files with 4 additions and 6 deletions

View File

@@ -66,11 +66,9 @@ namespace Flowframes.IO
foreach (string line in File.ReadAllLines(framesFile))
{
string relTargetPath =
line.Remove("file '").Split('\'').FirstOrDefault(); // Relative path in frames file
string relTargetPath = line.Remove("file '").Split('\'').FirstOrDefault(); // Relative path in frames file
string absTargetPath = Path.Combine(framesFile.GetParentDir(), relTargetPath); // Full path to frame
string linkPath = Path.Combine(linksDir,
counter.ToString().PadLeft(zPad, '0') + Path.GetExtension(relTargetPath));
string linkPath = Path.Combine(linksDir, counter.ToString().PadLeft(zPad, '0') + Path.GetExtension(relTargetPath));
pathsLinkTarget.Add(linkPath, absTargetPath);
counter++;
}

View File

@@ -154,7 +154,7 @@ namespace Flowframes.Main
float currentFrameTime = 1 + (step * i);
string filename = $"{Paths.interpDir}/{(i + 1).ToString().PadLeft(Padding.interpFrames, '0')}{ext}";
string note = $"Frame {currentFrameTime.ToString("0.0000")} {(currentFrameTime.ToString("0.0000").EndsWith("0000") ? $"[Source Frame {frameFiles[(int)currentFrameTime - 1]}]" : "[Interp]")}";
string note = $"Frame {currentFrameTime.ToString("0.0000")}";
fileContent += $"file '{filename}' # {note}\n";
}

View File

@@ -322,7 +322,7 @@ namespace Flowframes.Os
Process dain = OsUtils.NewProcess(!OsUtils.ShowHiddenCmd());
AiStarted(dain, 1500);
SetProgressCheck(outPath, factor);
int targetFrames = ((IoUtils.GetAmountOfFiles(lastInPath, false, "*.*") * factor).RoundToInt()) - (factor.RoundToInt() - 1); // TODO: Maybe won't work with fractional factors ??
int targetFrames = ((IoUtils.GetAmountOfFiles(lastInPath, false, "*.*") * factor).RoundToInt());
string args = $" -v -i {framesPath.Wrap()} -o {outPath.Wrap()} -n {targetFrames} -m {mdl.ToLower()}" +
$" -t {GetNcnnTilesize(tilesize)} -g {Config.Get(Config.Key.ncnnGpus)} -f {GetNcnnPattern()} -j 2:1:2";