Files
flowframes/Code/Data/AI.cs

42 lines
1.6 KiB
C#
Raw Normal View History

2021-08-23 16:50:18 +02:00
using Flowframes.IO;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Flowframes.Data
{
2022-05-31 22:17:22 +02:00
public class AI
2021-08-23 16:50:18 +02:00
{
2022-05-31 22:17:22 +02:00
public enum AiBackend { Pytorch, Ncnn, Tensorflow, Other }
public AiBackend Backend { get; set; } = AiBackend.Pytorch;
public string AiName { get; set; } = "";
public string AiNameShort { get; set; } = "";
public string FriendlyName { get; set; } = "";
public string Description { get; set; } = "";
public string PkgDir { get; set; } = "";
public enum InterpFactorSupport { Fixed, AnyPowerOfTwo, AnyInteger, AnyFloat }
public InterpFactorSupport FactorSupport { get; set; } = InterpFactorSupport.Fixed;
public int[] SupportedFactors { get; set; } = new int[0];
public bool Piped { get; set; } = false;
2021-08-23 16:50:18 +02:00
public string LogFilename { get { return AiName.Replace("_", "-").ToLower() + "-log"; } }
2022-05-31 22:17:22 +02:00
public AI(AiBackend backend, string aiName, string friendlyName, string desc, string pkgDir, InterpFactorSupport factorSupport = InterpFactorSupport.Fixed, int[] supportedFactors = null)
2021-08-23 16:50:18 +02:00
{
2022-05-31 22:17:22 +02:00
Backend = backend;
AiName = aiName;
AiNameShort = aiName.Split(' ')[0].Split('_')[0];
FriendlyName = friendlyName;
Description = desc;
PkgDir = pkgDir;
SupportedFactors = supportedFactors;
FactorSupport = factorSupport;
2022-07-04 10:14:31 +02:00
if (backend == AiBackend.Pytorch)
Description += " (Nvidia Only!)";
2021-08-23 16:50:18 +02:00
}
}
}