public FaceAnalyzerService()
 {
     _cascadeClassifier = new CascadeClassifier(@"haarcascade_frontalface_alt_tree.xml");
     _context           = new KataskopeyaContext();
     _recognitionEngine = new RecognizerEngine(@"trainningData.YAML");
     //Task.Run(() => _recognitionEngine.TrainRecognizer()).Wait();
 }
        public RecognizerEngine(string recognizerFilePath)
        {
            recognizerPath = recognizerFilePath;
            faceRecognizer = new LBPHFaceRecognizer(1, 8, 8, 8, 100);
            //recognizer = new EigenFaceRecognizer(80, double.PositiveInfinity);
            //recognizer = new FisherFaceRecognizer(0, 3500);//4000

            _context = new KataskopeyaContext();
        }
        public static void SeedDatabase(KataskopeyaContext context)
        {
            if (!context.Users.Any())
            {
                //var directory = new DirectoryInfo(FileSystemPaths.DebugFolder + "photosDataset");
                //var files = directory.GetFiles("*.png");

                //var myFiles = files.Where(x => x.Name.Contains("myPhoto"));

                //var myPhotos = new List<byte[]>();

                //foreach (var photo in myFiles)
                //{
                //    myPhotos.Add(File.ReadAllBytes(AppDomain.CurrentDomain.BaseDirectory + $"photosDataset/{photo.Name}"));
                //}

                var user = new User
                {
                    Name     = "Creator",
                    Password = "******",
                    Age      = 23,
                };

                context.Users.Add(user);

                //foreach (var image in myPhotos)
                //{
                //    var userFaceImage = new UserFaceImage
                //    {
                //        FaceImage = new FaceImage
                //        {
                //            Face = image
                //        },
                //        UserId = user.Id
                //    };

                //    context.UserFaceImages.Add(userFaceImage);
                //}

                context.SaveChanges();
            }
        }
Exemple #4
0
 public App()
 {
     _context = new KataskopeyaContext();
 }
 public CamerasService()
 {
     _context = new KataskopeyaContext();
 }
 public FaceScannerService()
 {
     _cascadeClassifier = new CascadeClassifier(@"haarcascade_frontalface_alt_tree.xml");
     _context           = new KataskopeyaContext();
 }
 public LoginViewModel()
 {
     _context = new KataskopeyaContext();
 }
 public FaceImageProcessor()
 {
     _context = new KataskopeyaContext();
 }