using System.Collections.Generic; using UnityEngine; public class YogaDataLoader { public static YogaData LoadData(int index) { //Resources.Load("YogaActions/YogaAction" + ActionIndex); Dictionary data = new Dictionary(); #if UNITY_EDITOR data[-1] = new YogaData() { VideoPath = "Video/Action3", Actions = new List() { AvatarAction.SitUpright, AvatarAction.Nod }, //Action = AvatarAction.Nod, ModelType = ModelType.OpenPose, MaxCheckPointCount = 1000, RectCutRate = 0.2f, MustPoints = new List() { "Nose", "Neck" },//{"REye", "LEye"} //AnyPoints = new List() { "RWrist", "LWrist" } }; #endif data[1] = new YogaData() { VideoPath = "Video/Action1", Actions = new List() { AvatarAction.SitUpright, AvatarAction.HeadShake }, //Action = AvatarAction.HeadShake, ModelType = ModelType.OpenPose, MaxCheckPointCount = 4, RectCutRate = 0.25f, MustPoints = new List() { "Nose", /*"REye", "LEye", */"Neck" } }; data[2] = new YogaData() { VideoPath = "Video/Action2", Actions = new List() { AvatarAction.SitUpright, AvatarAction.Nod }, //Action = AvatarAction.Nod, ModelType = ModelType.OpenPose, MaxCheckPointCount = 4, RectCutRate = 0.25f, MustPoints = new List() { "Nose",/* "REye", "LEye", */"Neck" } }; data[3] = new YogaData() { VideoPath = "Video/Action3", Actions = new List() { AvatarAction.SitUpright, AvatarAction.LateralHead }, //Action = AvatarAction.LateralHead, ModelType = ModelType.OpenPose, MaxCheckPointCount = 4, MustPoints = new List() { "REye", "LEye" } }; if (data.ContainsKey(index)) return data[index]; else { LogPrint.Error("YogaDataLoader.LoadData: index out of range"); } return null; } } public class YogaData { public string VideoPath; internal List Actions; //public AvatarAction Action; public ModelType ModelType; public int MaxCheckPointCount; public float RectCutRate; public List MustPoints = new List(); public List AnyPoints = new List(); } public enum ModelType { OpenPose, YoloV7, MediapipePose, MediapipePersonDetect, //, }