mirror of
https://github.com/n00mkrad/flowframes.git
synced 2025-12-25 12:49:26 +01:00
AI Class/Constructor revamp
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user