diff --git a/Code/Form1.cs b/Code/Form1.cs index a31bd6f6..74c3d316 100644 --- a/Code/Form1.cs +++ b/Code/Form1.cs @@ -58,9 +58,17 @@ private void Form1_Load(object sender, EventArgs e) void Checks() { - GetWebInfo.LoadNews(newsLabel); - GetWebInfo.LoadPatronList(patronsLabel); - Updater.AsyncUpdateCheck(); + try + { + GetWebInfo.LoadNews(newsLabel); + GetWebInfo.LoadPatronListCsv(patronsLabel); + Updater.AsyncUpdateCheck(); + } + catch (Exception e) + { + Logger.Log("Non-critical error while performing online checks. See logs for details."); + Logger.Log(e.Message + "\n" + e.StackTrace, true); + } } public HTTabControl GetMainTabControl() { return mainTabControl; } diff --git a/Code/Main/CreateVideo.cs b/Code/Main/CreateVideo.cs index 3e99ae50..f881c51e 100644 --- a/Code/Main/CreateVideo.cs +++ b/Code/Main/CreateVideo.cs @@ -20,7 +20,6 @@ class CreateVideo { public static async Task Export(string path, string outPath, i.OutMode mode) { - Logger.Log("Auto-Encode is off, exporting video..."); if (!mode.ToString().ToLower().Contains("vid")) // Copy interp frames out of temp folder and skip video export for image seq export { try diff --git a/Code/OS/AiProcess.cs b/Code/OS/AiProcess.cs index debe3604..5ca73846 100644 --- a/Code/OS/AiProcess.cs +++ b/Code/OS/AiProcess.cs @@ -271,7 +271,7 @@ static void LogOutput (string line, string logFilename) if (!hasShownError && line.ToLower().Contains("modulenotfounderror")) { hasShownError = true; - InterpolateUtils.ShowMessage($"A python module is missing. Check {logFilename} for details.\n\n{line}\n\nIf you don't want to install it yourself, use the Python package from the Package Installer.", "Error"); + InterpolateUtils.ShowMessage($"A python module is missing.\nCheck {logFilename} for details.\n\n{line}\n\nIf you don't want to install it yourself, use the Python package from the Package Installer.", "Error"); } if (!hasShownError && line.ToLower().Contains("no longer supports this gpu")) @@ -280,10 +280,10 @@ static void LogOutput (string line, string logFilename) InterpolateUtils.ShowMessage($"Your GPU seems to be outdated and is not supported!\n\n{line}", "Error"); } - if (!hasShownError && line.Contains("RuntimeError")) + if (!hasShownError && (line.Contains("RuntimeError") || line.Contains("ImportError") || line.Contains("OSError"))) { hasShownError = true; - InterpolateUtils.ShowMessage($"An error occured during interpolation!\n\n{line}", "Error"); + InterpolateUtils.ShowMessage($"A python error occured during interpolation!\nCheck {logFilename} for details.\n\n{line}", "Error"); } if (!hasShownError && line.Contains("vkQueueSubmit failed")) diff --git a/Code/OS/Pytorch.cs b/Code/OS/Pytorch.cs index 52f3baea..9169a9cd 100644 --- a/Code/OS/Pytorch.cs +++ b/Code/OS/Pytorch.cs @@ -14,10 +14,14 @@ class Pytorch public static string GetPyCmd () { - if (PkgUtils.IsInstalled(Packages.python)) + if (Directory.Exists(Path.Combine(Paths.GetPkgPath(), "py-tu")) || Directory.Exists(Path.Combine(Paths.GetPkgPath(), "py-ampt"))) { Logger.Log("Using embedded Python runtime."); - string pyPkgDir = Path.Combine(Paths.GetPkgPath(), Path.GetFileNameWithoutExtension(Packages.python.fileName)); + string pyPkgDir = Path.Combine(Paths.GetPkgPath(), "py-amp"); + if (!Directory.Exists(pyPkgDir)) + pyPkgDir = Path.Combine(Paths.GetPkgPath(), "py-tu"); + if (!Directory.Exists(pyPkgDir)) + return ""; return Path.Combine(pyPkgDir, "python.exe").Wrap(); } else diff --git a/Code/UI/GetWebInfo.cs b/Code/UI/GetWebInfo.cs index a68ae459..9f7008ab 100644 --- a/Code/UI/GetWebInfo.cs +++ b/Code/UI/GetWebInfo.cs @@ -25,5 +25,46 @@ public static async Task LoadPatronList(Label patronsLabel) var str = await client.DownloadStringTaskAsync(new Uri(url)); patronsLabel.Text = str; } + + public static async Task LoadPatronListCsv(Label patronsLabel) + { + string url = $"http://dl.nmkd.de/flowframes/patrons.csv"; + var client = new WebClient(); + var csvData = await client.DownloadStringTaskAsync(new Uri(url)); + patronsLabel.Text = ParsePatreonCsv(csvData); + } + + public static string ParsePatreonCsv(string csvData) + { + List goldPatrons = new List(); + List silverPatrons = new List(); + string str = "Gold:\n"; + string[] lines = csvData.SplitIntoLines(); + for (int i = 0; i < lines.Length; i++) + { + string line = lines[i]; + string[] values = line.Split(','); + if (i == 0 || line.Length < 10 || values.Length < 5) continue; + string name = values[0]; + float amount = float.Parse(values[7], System.Globalization.CultureInfo.InvariantCulture); + if(amount >= 4.5f) + { + if (amount >= 11f) + goldPatrons.Add(name); + else + silverPatrons.Add(name); + } + } + + foreach (string pat in goldPatrons) + str += pat + "\n"; + + str += "\nSilver:\n"; + + foreach (string pat in silverPatrons) + str += pat + "\n"; + + return str; + } } } diff --git a/PythonDependencies.md b/PythonDependencies.md new file mode 100644 index 00000000..565cc821 --- /dev/null +++ b/PythonDependencies.md @@ -0,0 +1,10 @@ +# Installation Of Python And Dependencies + +- Make sure your GPU drivers are up to date +- Install Python 3.8.6 from the [official website](https://www.python.org/downloads/release/python-386/) +- In CMD, run `pip install torch===1.7.0+cu110 torchvision===0.8.1+cu110 -f https://download.pytorch.org/whl/torch_stable.html` +- Run `pip install opencv-python sk-video imageio` + + + +This should be sufficient to run RIFE and other Pytorch-based networks on any modern GPU, including the RTX 3000 (Ampere) series. \ No newline at end of file