Adjust code for RIFE 3.9

This commit is contained in:
n00mkrad
2021-11-24 13:48:04 +01:00
parent 8cab96e099
commit 694d8f5de0
3 changed files with 10 additions and 9 deletions

View File

@@ -5,7 +5,7 @@ namespace Flowframes.Data
class Implementations
{
public static AI rifeCuda = new AI(AI.Backend.Pytorch, "RIFE_CUDA", "RIFE",
"CUDA/Pytorch Implementation of RIFE (Nvidia Only!)", "rife-cuda", new int[] { 2, 4, 8, 16 });
"CUDA/Pytorch Implementation of RIFE (Nvidia Only!)", "rife-cuda", new int[] { 2, 3, 4, 5, 6, 7, 8, 9, 10 });
public static AI rifeNcnn = new AI(AI.Backend.Ncnn, "RIFE_NCNN", "RIFE (NCNN)",
"Vulkan/NCNN Implementation of RIFE", "rife-ncnn", new int[] { 2, 4, 8 }, true);

View File

@@ -148,7 +148,7 @@ namespace Flowframes.Os
string rbuffer = $"--rbuffer {Config.GetInt(Config.Key.rifeCudaBufferSize, 200)}";
//string scale = $"--scale {Config.GetFloat("rifeCudaScale", 1.0f).ToStringDot()}";
string prec = Config.GetBool(Config.Key.rifeCudaFp16) ? "--fp16" : "";
string args = $" --input {inPath.Wrap()} --output {outDir} --model {mdl} --exp {(int)Math.Log(interpFactor, 2)} {uhdStr} {wthreads} {rbuffer} {prec}";
string args = $" --input {inPath.Wrap()} --output {outDir} --model {mdl} --multi {interpFactor} {uhdStr} {wthreads} {rbuffer} {prec}";
Process rifePy = OsUtils.NewProcess(!OsUtils.ShowHiddenCmd());
AiStarted(rifePy, 3500);

View File

@@ -135,13 +135,14 @@ namespace Flowframes.Ui
if (factor > 256)
return 256;
if (ai.aiName == Implementations.rifeCuda.aiName)
{
if (!IsPowerOfTwo(factor))
{
return Implementations.rifeCuda.supportedFactors.Last();
}
}
// NO LONGER NEEDED WITH RIFE 3.9
//if (ai.aiName == Implementations.rifeCuda.aiName)
//{
// if (!IsPowerOfTwo(factor))
// {
// return Implementations.rifeCuda.supportedFactors.Last();
// }
//}
return factor;
}