Пример #1
0
        List <Mat> Detect(Image <Bgr, byte> img, bool xoay = true)
        {
            string _dir        = FileAndFolder.GetRunningPath();
            string modelDetect = Path.Combine(_dir, "lib", "pcn_model");
            var    api         = new APIGetFace(
                Path.Combine(modelDetect, "PCN-1.prototxt"),
                Path.Combine(modelDetect, "PCN-2.prototxt"),
                Path.Combine(modelDetect, "PCN-3.prototxt"),
                Path.Combine(modelDetect, "PCN.caffemodel")
                );
            //  var list = API.Recognize_FaceKit(img);
            var list = api.GetFace(img, 30, xoay);

            return(list);
        }
Пример #2
0
        List <float[]> FaceNet(Image <Bgr, byte> imgRoot)
        {
            var    result      = new List <float[]>();
            string _dir        = FileAndFolder.GetRunningPath();
            string modelFace   = Path.Combine(_dir, "lib", "FaceModel", "facemodel.pb");
            string modelTensor = Path.Combine(_dir, "lib", "FaceModel", "facetesor.dll");
            var    api         = new APIRecognizeFace(modelFace, modelTensor);
            var    facesInRoot = Detect(imgRoot);

            foreach (var item in facesInRoot)
            {
                var ar = api.FaceNet(item);
                result.Add(ar);
            }
            return(result);
        }