예제 #1
0
 public void AddClassifier(string Key, NetEvaluation Net, int Edge, System.Windows.Media.Brush BbColor)
 {
     Classifier.Add(Key, Net);
     edge.Add(Key, Edge);
     array.Add(Key, new float[Edge * Edge * 3]);
     BoundingBox.Add(Key, new BoundingBoxes());
     bbColor.Add(Key, BbColor);
 }
        public MainWindow()
        {
            InitializeComponent();

            #region instanciar variables globales
            string modelpath;

            CW = new CaptureWebCam(Image1);

            modelpath = @"E:\DeepLearning\Faces12Final\01_Convolution.293";

            //   modelpath = @"E:\DeepLearning\Faces12Final\02_BatchNormConv.417";
            FDC12 = new NetEvaluation(modelpath);

            //modelpath = @"E:\DeepLearning\cntk\Examples\FaceDetection16X16X3_VF\Output\Models\01_Convolution.77";
            modelpath = @"E:\DeepLearning\cntk\Examples\FaceDetection16X16X3_VF\Output\Models\01_Convolution.16";
            FDC16     = new NetEvaluation(modelpath);

            modelpath = @"E:\DeepLearning\cntk\Examples\FaceDetection24X24X3V2\Output\Models\01_Convolution.21";
            FDC24     = new NetEvaluation(modelpath);

            modelpath = @"E:\DeepLearning\cntk\Examples\FaceDetectionModels\Models\01_Convolution.100";
            FDC32     = new NetEvaluation(modelpath);



            modelpath = @"E:\DeepLearning\cntk\Examples\FaceDetection32X32X3\Output\Models\01_Convolution2.63";
            FDC32_2   = new NetEvaluation(modelpath);

            EV = new FaceDetector(Canvas1, 128, 4, 1.5f);
            EV.AddClassifier("322", FDC32_2, 32);
            EV.AddClassifier("32", FDC32, 24);
            EV.AddClassifier("24", FDC24, 24, Brushes.SkyBlue);
            EV.AddClassifier("16", FDC16, 16, Brushes.Violet);
            EV.AddClassifier("12", FDC12, 12, Brushes.YellowGreen);


            CascadeFaceDetectorDic = new Dictionary <string, float>();
            CascadeFaceDetectorDic.Add("12", 0.4f);
            CascadeFaceDetectorDic.Add("24", 0.6f);
            //s CascadeFaceDetectorDic.Add("322",0.645f);
//

            #endregion

            #region procesos temporales
            //  Utils.ReadFDDBFile(@"E:\Bases de datos\FDDB\FDDB-folds\FDDB-fold-01-ellipseList.txt");
            //  /    Utils.printOutputAndTargetList(FDC16.ReadUciFastReaderAndEvaluate(@"E:\Bases de datos\DatasetFacedetectionUCIreader\facedetector16X16X3Test.txt"));
            //fddb = new FDDB(EV);
            // fddbdatagenerate();

            #endregion
        }
예제 #3
0
 /// <summary>
 /// Add a classifier
 /// </summary>
 /// <param name="Key"> key of the classifier</param>
 /// <param name="Net"> classifier</param>
 /// <param name="Edge">Borde</param>
 public void AddClassifier(string Key, NetEvaluation Net, int Edge)
 {
     AddClassifier(Key, Net, Edge, colors[colorIndex]);
 }