/// <summary> /// Entry point for setting up and running the experiments. /// </summary> public void Initialize() { //load gesture data and report on the number and type of available samples dataset = DataLoader.LoadGestureDataFrom(Config.DataPath); int training = 0; foreach (UserDataSet user_i in dataset) { training += user_i.TrainingSamples.Count; } ToTrain = new Dictionary<GestureType, List<GestureSample>>(); foreach (GestureType gesture in Config.GesturesToUse) { ToTrain.Add(gesture, new List<GestureSample>()); } foreach (UserDataSet uData in dataset) { //1-construct/prune the 'ToTrain' collection for training the Classifier //add all training samples into the 'ToTrain' collection. //sort training samples into classes foreach (GestureSample sample in uData.TrainingSamples) if (Config.GesturesToUse.Contains(sample.Gesture)) ToTrain[sample.Gesture].Add(sample); } Recognizer = new LinearClassifier(ToTrain); }
/// <summary> /// Entry point for setting up and running the experiments. /// </summary> public void RunExperiments() { //load gesture data and report on the number and type of available samples dataset = DataLoader.LoadGestureDataFrom(Config.DataPath); int training = 0; foreach (UserDataSet user_i in dataset) { training += user_i.TrainingSamples.Count; } ToTrain = new Dictionary<GestureType, List<GestureSample>>(); ToRecognize_Training = new Dictionary<GestureType, List<GestureSample>>(); foreach (GestureType gesture in Config.GesturesToUse) { ToTrain.Add(gesture, new List<GestureSample>()); ToRecognize_Training.Add(gesture, new List<GestureSample>()); } PopulateDataSets(); Recognizer = new LinearClassifier(ToTrain); Run(); Console.WriteLine(); }