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", Action = AvatarAction.HeadShake, ModelType = ModelType.OpenPose, MaxActionCount = 1000, TotalSeconds = 20.0f, RectCutRate = 0.2f, MustPoints = new List() { "Nose", /*"REye", "LEye", */"Neck" }, //AnyPoints = new List() { "RWrist", "LWrist" } }; #endif data[1] = new YogaData() { VideoPath = "Video/Action1", Action = AvatarAction.HeadShake, ModelType = ModelType.OpenPose, MaxActionCount = 4, TotalSeconds = 20.0f, RectCutRate = 0.25f, MustPoints = new List() { "Nose", /*"REye", "LEye", */"Neck" } }; data[2] = new YogaData() { VideoPath = "Video/Action2", Action = AvatarAction.Nod, ModelType = ModelType.OpenPose, MaxActionCount = 4, TotalSeconds = 20.0f, RectCutRate = 0.25f, MustPoints = new List() { "Nose", "REye", "LEye", "Neck" } }; data[3] = new YogaData() { VideoPath = "Video/Action3", Action = AvatarAction.HandsUp, ModelType = ModelType.MediapipePose, MaxActionCount = 4, TotalSeconds = 12.66f, MustPoints = new List() { "Nose", "RShoulder", "LShoulder", "RElbow", "LElbow" } }; if (data.ContainsKey(index)) return data[index]; else { LogPrint.Error("YogaDataLoader.LoadData: index out of range"); } return null; } } public class YogaData { public string VideoPath; public AvatarAction Action; public ModelType ModelType; public int MaxActionCount; public float TotalSeconds; public float RectCutRate; public List MustPoints = new List(); public List AnyPoints = new List(); } public enum ModelType { OpenPose, YoloV7, MediapipePose, MediapipePersonDetect, //, }