AI Class/Constructor revamp

This commit is contained in:
n00mkrad
2022-07-21 10:08:53 +02:00
parent 9be08deb4c
commit 760a187dfe
17 changed files with 68 additions and 54 deletions

View File

@@ -19,7 +19,7 @@ namespace Flowframes.Main
if (!File.Exists(modelsFile))
{
Logger.Log($"Error: File models.json is missing for {ai.AiName}, can't load AI models for this implementation!");
Logger.Log($"Error: File models.json is missing for {ai.NameInternal}, can't load AI models for this implementation!");
return new ModelCollection(ai);
}

View File

@@ -82,7 +82,7 @@ namespace Flowframes.Main
string fname = Path.GetFileName(entry.inPath);
if (IoUtils.IsPathDirectory(entry.inPath)) fname = Path.GetDirectoryName(entry.inPath);
Logger.Log($"Queue: Processing {fname} ({entry.interpFactor}x {entry.ai.AiNameShort}).");
Logger.Log($"Queue: Processing {fname} ({entry.interpFactor}x {entry.ai.NameShort}).");
MediaFile mf = new MediaFile(entry.inPath);
await mf.Initialize();
@@ -98,7 +98,7 @@ namespace Flowframes.Main
Program.batchQueue.Dequeue();
Program.mainForm.SetWorking(false);
Logger.Log($"Queue: Done processing {fname} ({entry.interpFactor}x {entry.ai.AiNameShort}).");
Logger.Log($"Queue: Done processing {fname} ({entry.interpFactor}x {entry.ai.NameShort}).");
}
static void SetBusy(bool state)

View File

@@ -196,25 +196,25 @@ namespace Flowframes
List<Task> tasks = new List<Task>();
if (ai.AiName == Implementations.rifeCuda.AiName)
if (ai.NameInternal == Implementations.rifeCuda.NameInternal)
tasks.Add(AiProcess.RunRifeCuda(currentSettings.framesFolder, currentSettings.interpFactor, currentSettings.model.dir));
if (ai.AiName == Implementations.rifeNcnn.AiName)
if (ai.NameInternal == Implementations.rifeNcnn.NameInternal)
tasks.Add(AiProcess.RunRifeNcnn(currentSettings.framesFolder, outpath, currentSettings.interpFactor, currentSettings.model.dir));
if (ai.AiName == Implementations.rifeNcnnVs.AiName)
if (ai.NameInternal == Implementations.rifeNcnnVs.NameInternal)
tasks.Add(AiProcess.RunRifeNcnnVs(currentSettings.framesFolder, outpath, currentSettings.interpFactor, currentSettings.model.dir));
if (ai.AiName == Implementations.flavrCuda.AiName)
if (ai.NameInternal == Implementations.flavrCuda.NameInternal)
tasks.Add(AiProcess.RunFlavrCuda(currentSettings.framesFolder, currentSettings.interpFactor, currentSettings.model.dir));
if (ai.AiName == Implementations.dainNcnn.AiName)
if (ai.NameInternal == Implementations.dainNcnn.NameInternal)
tasks.Add(AiProcess.RunDainNcnn(currentSettings.framesFolder, outpath, currentSettings.interpFactor, currentSettings.model.dir, Config.GetInt(Config.Key.dainNcnnTilesize, 512)));
if (ai.AiName == Implementations.xvfiCuda.AiName)
if (ai.NameInternal == Implementations.xvfiCuda.NameInternal)
tasks.Add(AiProcess.RunXvfiCuda(currentSettings.framesFolder, currentSettings.interpFactor, currentSettings.model.dir));
if(ai.AiName == Implementations.ifrnetNcnn.AiName)
if(ai.NameInternal == Implementations.ifrnetNcnn.NameInternal)
tasks.Add(AiProcess.RunIfrnetNcnn(currentSettings.framesFolder, outpath, currentSettings.interpFactor, currentSettings.model.dir));
if (currentlyUsingAutoEnc)

View File

@@ -161,7 +161,7 @@ namespace Flowframes.Main
return false;
}
if (I.currentSettings.ai.AiName.ToUpper().Contains("CUDA") && NvApi.gpuList.Count < 1)
if (I.currentSettings.ai.NameInternal.ToUpper().Contains("CUDA") && NvApi.gpuList.Count < 1)
{
UiUtils.ShowMessageBox("Warning: No Nvidia GPU was detected. CUDA might fall back to CPU!\n\nTry an NCNN implementation instead if you don't have an Nvidia GPU.", UiUtils.MessageType.Error);