public static void AddFace(DetectedFace face, CategoryEnum cat, string path)
        {
            var cropped = new CroppedBitmap(new BitmapImage(new Uri(path)), new Int32Rect(
                                                face.FaceRectangle.Left, face.FaceRectangle.Top,
                                                face.FaceRectangle.Width, face.FaceRectangle.Height));
            BitmapSource source = cropped;
            BitmapImage  image  = ImageExtensions.BitmapSourceToBitmapImage(source);

            categories.AddCategoryFace(new Face(
                                           (double)face.FaceAttributes.Age, face.FaceAttributes.Gender.ToString(),
                                           ImageExtensions.BufferFromImage(image),
                                           cat));
        }