private void InitFaceDetector() { if (_faceDetector == null) { InitPath(); String ssdFileLocal = MaskRcnnPage.DnnDownloadFile( "https://github.com/opencv/opencv_3rdparty/raw/dnn_samples_face_detector_20170830/", "res10_300x300_ssd_iter_140000.caffemodel", _path); String ssdProtoFileLocal = MaskRcnnPage.DnnDownloadFile( "https://raw.githubusercontent.com/opencv/opencv/4.0.1/samples/dnn/face_detector/", "deploy.prototxt", _path); _faceDetector = DnnInvoke.ReadNetFromCaffe(ssdProtoFileLocal, ssdFileLocal); } }
private void InitFacemark() { if (_facemark == null) { InitPath(); String facemarkFileName = "lbfmodel.yaml"; String facemarkFileUrl = "https://raw.githubusercontent.com/kurnianggoro/GSOC2017/master/data/"; String facemarkFileLocal = MaskRcnnPage.DnnDownloadFile( facemarkFileUrl, facemarkFileName, _path); using (FacemarkLBFParams facemarkParam = new CV.Face.FacemarkLBFParams()) { _facemark = new CV.Face.FacemarkLBF(facemarkParam); _facemark.LoadModel(facemarkFileLocal); } } }