Пример #1
0
        private void InitFaceDetector()
        {
            if (_faceDetector == null)
            {
                InitPath();
                String ssdFileLocal = DnnPage.DnnDownloadFile(
                    "https://github.com/opencv/opencv_3rdparty/raw/dnn_samples_face_detector_20170830/",
                    "res10_300x300_ssd_iter_140000.caffemodel",
                    _path);

                String ssdProtoFileLocal = DnnPage.DnnDownloadFile(
                    "https://raw.githubusercontent.com/opencv/opencv/4.0.1/samples/dnn/face_detector/",
                    "deploy.prototxt",
                    _path);
                _faceDetector = DnnInvoke.ReadNetFromCaffe(ssdProtoFileLocal, ssdFileLocal);
            }
        }
Пример #2
0
        private void InitFacemark()
        {
            if (_facemark == null)
            {
                InitPath();
                String facemarkFileName  = "lbfmodel.yaml";
                String facemarkFileUrl   = "https://raw.githubusercontent.com/kurnianggoro/GSOC2017/master/data/";
                String facemarkFileLocal = DnnPage.DnnDownloadFile(
                    facemarkFileUrl,
                    facemarkFileName,
                    _path);

                using (FacemarkLBFParams facemarkParam = new CV.Face.FacemarkLBFParams())
                {
                    _facemark = new CV.Face.FacemarkLBF(facemarkParam);
                    _facemark.LoadModel(facemarkFileLocal);
                }
            }
        }