mirror of
https://github.com/n00mkrad/flowframes.git
synced 2025-12-25 20:59:39 +01:00
Server manager with ping check, better error handling for missing model files
This commit is contained in:
@@ -16,6 +16,13 @@ namespace Flowframes.Main
|
||||
{
|
||||
string pkgPath = Path.Combine(Paths.GetPkgPath(), ai.pkgDir);
|
||||
string modelsFile = Path.Combine(pkgPath, "models.json");
|
||||
|
||||
if (!File.Exists(modelsFile))
|
||||
{
|
||||
Logger.Log($"Error: File models.json is missing for {ai.aiName}, can't load AI models for this implementation!");
|
||||
return new ModelCollection(ai);
|
||||
}
|
||||
|
||||
ModelCollection modelCollection = new ModelCollection(ai, modelsFile);
|
||||
|
||||
foreach (string customModel in GetCustomModels(ai))
|
||||
|
||||
@@ -37,7 +37,7 @@ namespace Flowframes
|
||||
Program.initialRun = false;
|
||||
Program.mainForm.SetWorking(true);
|
||||
if (!Utils.InputIsValid(current.inPath, current.outPath, current.outFps, current.interpFactor, current.outMode)) return; // General input checks
|
||||
if (!Utils.CheckAiAvailable(current.ai)) return; // Check if selected AI pkg is installed
|
||||
if (!Utils.CheckAiAvailable(current.ai, current.model)) return; // Check if selected AI pkg is installed
|
||||
if (!ResumeUtils.resumeNextRun && !Utils.CheckDeleteOldTempFolder()) return; // Try to delete temp folder if an old one exists
|
||||
if (!Utils.CheckPathValid(current.inPath)) return; // Check if input path/file is valid
|
||||
if (!(await Utils.CheckEncoderValid())) return; // Check NVENC compat
|
||||
|
||||
@@ -69,7 +69,7 @@ namespace Flowframes.Main
|
||||
|
||||
public static async Task InterpolateStep()
|
||||
{
|
||||
if (!InterpolateUtils.CheckAiAvailable(current.ai)) return;
|
||||
if (!InterpolateUtils.CheckAiAvailable(current.ai, current.model)) return;
|
||||
|
||||
current.framesFolder = Path.Combine(current.tempFolder, Paths.framesDir);
|
||||
|
||||
|
||||
@@ -138,7 +138,7 @@ namespace Flowframes.Main
|
||||
}
|
||||
}
|
||||
|
||||
public static bool CheckAiAvailable(AI ai)
|
||||
public static bool CheckAiAvailable(AI ai, ModelCollection.ModelInfo model)
|
||||
{
|
||||
if (IoUtils.GetAmountOfFiles(Path.Combine(Paths.GetPkgPath(), ai.pkgDir), true) < 1)
|
||||
{
|
||||
@@ -147,6 +147,13 @@ namespace Flowframes.Main
|
||||
return false;
|
||||
}
|
||||
|
||||
if (model == null || model.dir.Trim() == "")
|
||||
{
|
||||
ShowMessage("No valid AI model has been selected!", "Error");
|
||||
I.Cancel("No valid model selected.", true);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (I.current.ai.aiName.ToUpper().Contains("CUDA") && NvApi.gpuList.Count < 1)
|
||||
{
|
||||
ShowMessage("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.", "Error");
|
||||
|
||||
Reference in New Issue
Block a user