Store backend in AI Implementation struct

This commit is contained in:
n00mkrad
2021-08-31 00:09:47 +02:00
parent e51909bf6e
commit 9b72b88526
2 changed files with 26 additions and 16 deletions

View File

@@ -9,6 +9,8 @@ namespace Flowframes.Data
{ {
public struct AI public struct AI
{ {
public enum Backend { Pytorch, Ncnn, Tensorflow, Other }
public Backend backend;
public string aiName; public string aiName;
public string aiNameShort; public string aiNameShort;
public string friendlyName; public string friendlyName;
@@ -17,15 +19,16 @@ namespace Flowframes.Data
public int[] supportedFactors; public int[] supportedFactors;
public bool multiPass; // Are multiple passes needed to get to the desired interp factor? public bool multiPass; // Are multiple passes needed to get to the desired interp factor?
public AI(string aiNameArg, string friendlyNameArg, string descArg, string pkgDirArg, int[] factorsArg, bool multiPassArg = false) public AI(Backend backend, string aiName, string friendlyName, string desc, string pkgDir, int[] factors, bool multiPass = false)
{ {
aiName = aiNameArg; this.backend = backend;
aiNameShort = aiNameArg.Split(' ')[0].Split('_')[0]; this.aiName = aiName;
friendlyName = friendlyNameArg; this.aiNameShort = aiName.Split(' ')[0].Split('_')[0];
description = descArg; this.friendlyName = friendlyName;
pkgDir = pkgDirArg; this.description = desc;
supportedFactors = factorsArg; this.pkgDir = pkgDir;
multiPass = multiPassArg; this.supportedFactors = factors;
this.multiPass = multiPass;
} }
} }
} }

View File

@@ -1,16 +1,23 @@
using Flowframes.IO; using System.Collections.Generic;
using System;
using System.Collections.Generic;
namespace Flowframes.Data namespace Flowframes.Data
{ {
class Implementations class Implementations
{ {
public static AI rifeCuda = new AI("RIFE_CUDA", "RIFE", "CUDA/Pytorch Implementation of RIFE (Nvidia Only!)", "rife-cuda", new int[] { 2, 4, 8, 16 }); public static AI rifeCuda = new AI(AI.Backend.Pytorch, "RIFE_CUDA", "RIFE",
public static AI rifeNcnn = new AI("RIFE_NCNN", "RIFE (NCNN)", "Vulkan/NCNN Implementation of RIFE", "rife-ncnn", new int[] { 2, 4, 8 }, true); "CUDA/Pytorch Implementation of RIFE (Nvidia Only!)", "rife-cuda", new int[] { 2, 4, 8, 16 });
public static AI flavrCuda = new AI("FLAVR_CUDA", "FLAVR", "Experimental Pytorch Implementation of FLAVR (Nvidia Only!)", "flavr-cuda", new int[] { 2, 4, 8 });
public static AI dainNcnn = new AI("DAIN_NCNN", "DAIN (NCNN)", "Vulkan/NCNN Implementation of DAIN", "dain-ncnn", new int[] { 2, 3, 4, 5, 6, 7, 8 }); public static AI rifeNcnn = new AI(AI.Backend.Ncnn, "RIFE_NCNN", "RIFE (NCNN)",
public static AI xvfiCuda = new AI("XVFI_CUDA", "XVFI", "CUDA/Pytorch Implementation of XVFI (Nvidia Only!)", "xvfi-cuda", new int[] { 2, 3, 4, 5, 6, 7, 8, 9, 10 }); "Vulkan/NCNN Implementation of RIFE", "rife-ncnn", new int[] { 2, 4, 8 }, true);
public static AI flavrCuda = new AI(AI.Backend.Pytorch, "FLAVR_CUDA", "FLAVR",
"Experimental Pytorch Implementation of FLAVR (Nvidia Only!)", "flavr-cuda", new int[] { 2, 4, 8 });
public static AI dainNcnn = new AI(AI.Backend.Ncnn, "DAIN_NCNN", "DAIN (NCNN)",
"Vulkan/NCNN Implementation of DAIN", "dain-ncnn", new int[] { 2, 3, 4, 5, 6, 7, 8 });
public static AI xvfiCuda = new AI(AI.Backend.Pytorch, "XVFI_CUDA", "XVFI",
"CUDA/Pytorch Implementation of XVFI (Nvidia Only!)", "xvfi-cuda", new int[] { 2, 3, 4, 5, 6, 7, 8, 9, 10 });
public static List<AI> networks = new List<AI> { rifeCuda, rifeNcnn, flavrCuda, dainNcnn, xvfiCuda }; public static List<AI> networks = new List<AI> { rifeCuda, rifeNcnn, flavrCuda, dainNcnn, xvfiCuda };