public async Task <List <NameBox> > GetNameBoxes() { var tuples = await this.RecogniseFaces(); List <NameBox> res = new List <NameBox>(); foreach (var tuple in tuples) { Face face = tuple.Item1; string name = tuple.Item2; NameBox nameBox = new NameBox(); nameBox.Width = face.FaceRectangle.Width; nameBox.Height = face.FaceRectangle.Height; nameBox.VerticalAlignment = VerticalAlignment.Top; nameBox.HorizontalAlignment = HorizontalAlignment.Left; nameBox.Margin = new Thickness(face.FaceRectangle.Left, face.FaceRectangle.Top, 0, 0); nameBox.NameText = name; nameBox.Description = FaceUtilities.FaceDescription(face); res.Add(nameBox); } return(res); }
public ImageRecogniserViewModel() { string[] images = FaceUtilities.GetAdminsImage(); recigniser.TrainFaces(images); }