首页 最新 热门 推荐

  • 首页
  • 最新
  • 热门
  • 推荐

百度人脸识别Windows C++离线sdk C#接入

  • 25-02-19 03:41
  • 2761
  • 11388
blog.csdn.net

百度人脸识别Windows C++离线sdk C#接入

目录

说明

设计背景

• 场景特点:

• 客户特点:

• 核心需求:

SDK 包结构

效果

代码


说明

自己根据SDK封装了动态库,然后C#调用。

功能接口

设计背景

• 场景特点:

-- 网络:对于无网、局域网等情况,无法连接公网,API 方式无法运作。如政府单
位、金融保险、教育机构等,其中内网情况最为常见,私有化部署是项目开展的前提
条件。
-- 安全:即使可以连接外网,因为人脸数据的敏感性,许多客户不希望将人脸数据传
入百度服务器,如大学学生照片、部分企业员工数据等,API 形式也往往不被接受。
-- 速度:由于各地网络线路、机房部署、图片采集方式等诸多原因,API 形式往往耗
时较高,容易存在部分请求耗时过长的情况,容易影响业务正常运转。
-- 稳定:API 形式容易受网络抖动、机房故障、线上连带 bug 等影响,存在一定的不
稳定因素,可用性保障,往往成为在线调用最容易出现问题的地方。

• 客户特点:

-- 1:N-小型人脸库检索:多为通道通行、固定区域人群验证等需求,如写字楼闸机
门禁、企业考勤打卡等,人脸库范围较小,且不易经常变动。
-- 1:1-自有数据源对比:将当前采集的人脸,与其他数据源中的人脸进行对比,如
身份证芯片照、教务系统图片、档案图片等,进行快速的 1:1 对比验证。

• 核心需求:

-- 基础的人脸采集:包含人脸检测、跟踪、捕获、质量校验等基础功能,获取符合识
别条件的人脸。为之前的客户端 SDK 的标准功能,离线版本 SDK 保留以上所有能
力。
-- 本地特征抽取:所有在 SDK 中运行的人脸图片,都可以完成本地特征抽取,以便
进行对比或识别操作。
-- 1:1 对比:支持两张图片的相似度对比,可直接传入图片,也可调用本地某个人
脸特征;
-- 1:N 搜索:支持一定库大小的人脸查找,在指定的人脸集合中查找最相似的人
脸,并返回相似度分值;

SDK 包结构

效果

代码

头文件

  1. #pragma once
  2. #include "targetver.h"
  3. #define WIN32_LEAN_AND_MEAN // 从 Windows 头中排除极少使用的资料
  4. // Windows 头文件:
  5. #include
  6. #include "baidu_face_api.h"
  7. #include
  8. #include
  9. using namespace std;
  10. using namespace cv;
  11. //创建实例
  12. extern "C" _declspec(dllexport) void* __cdecl create();
  13. //实例初始化
  14. extern "C" _declspec(dllexport) int __cdecl init(void* engine, char* model_path, char* code);
  15. //人脸检测
  16. extern "C" _declspec(dllexport) int __cdecl face_detect(void* engine, Mat* image, char* json_result);
  17. // 通过图片人脸特征值提取
  18. extern "C" _declspec(dllexport) int __cdecl face_feature(void* engine, Mat* image, char* json_result);
  19. // 人脸比对(通过传图片)
  20. extern "C" _declspec(dllexport) float __cdecl face_match_by_img(void* engine, Mat* image, Mat* image2);

源文件

  1. #include "stdafx.h"
  2. BaiduFaceApi *api;
  3. //创建实例
  4. void* __cdecl create() {
  5. api = new BaiduFaceApi();
  6. // 获取设备指纹
  7. std::string device_id;
  8. api->get_device_id(device_id);
  9. std::cout << "device id is:" << device_id << std::endl;
  10. // 获取sdk版本号
  11. std::string version;
  12. api->sdk_version(version);
  13. std::cout << "sdk version:" << version << std::endl;
  14. return api;
  15. }
  16. //实例初始化
  17. int __cdecl init(void* engine, char* model_path, char* code) {
  18. BaiduFaceApi* _api = (BaiduFaceApi*)engine;
  19. return (int)_api->sdk_init(model_path);
  20. }
  21. //人脸检测
  22. int __cdecl face_detect(void* engine, Mat* image, char* json_result) {
  23. BaiduFaceApi* _api = (BaiduFaceApi*)engine;
  24. std::vector<FaceBox> box_list;
  25. // type 0: 表示rgb 人脸检测 1:表示nir人脸检测
  26. int type = 0;
  27. int face_num = 0;
  28. face_num = _api->detect(box_list, image, 0);
  29. std::cout << "-----face_num is-------" << face_num << std::endl;
  30. std::string res_str("");
  31. if (face_num > 0)
  32. {
  33. for (int i = 0; i < face_num; i++)
  34. {
  35. FaceBox info = box_list.at(i);
  36. // 人脸置信度
  37. std::cout << "detect score is:" << info.score << std::endl;
  38. // 人脸宽度
  39. std::cout << "detect mWidth is:" << info.width << std::endl;
  40. // 中心点X,Y坐标
  41. std::cout << "detect mCenter_x is:" << info.center_x << std::endl;
  42. std::cout << "detect mCenter_y is:" << info.center_y << std::endl;
  43. std::string str = ("{\"center_x\":\"") + std::to_string(info.center_x) + ("\",") +
  44. "\"center_y\":\"" + std::to_string(info.center_y) + ("\",") +
  45. "\"width\":\"" + std::to_string(info.width) + ("\",") +
  46. "\"height\":\"" + std::to_string(info.height) + ("\",") +
  47. "\"score\":\"" + std::to_string(info.score) + "\"}";
  48. res_str = res_str + str.c_str();
  49. res_str += ",";
  50. }
  51. }
  52. if (res_str.length()>0)
  53. {
  54. res_str.erase(res_str.length() - 1);
  55. }
  56. res_str = "[" + res_str + "]";
  57. strcpy(json_result, res_str.c_str());
  58. return face_num;
  59. }
  60. // 通过图片人脸特征值提取
  61. int __cdecl face_feature(void* engine, Mat* image, char* json_result) {
  62. BaiduFaceApi* _api = (BaiduFaceApi*)engine;
  63. std::vector<Feature> out_fea1;
  64. std::vector<FaceBox> out_box1;
  65. // 提取第一个人的特征值
  66. // 特征值的type:传 0 可见光生活照特征值, 1、表示近红外特征值
  67. int type = 0;
  68. int face_num = 0;
  69. face_num = _api->face_feature(out_fea1, out_box1, image, type);
  70. std::cout << "face num is:" << face_num << std::endl;
  71. int size = out_fea1.size();
  72. std::string res_str("");
  73. for (int i = 0; i < size; i++) {
  74. Feature feature = out_fea1.at(i);
  75. FaceBox info = out_box1.at(i);
  76. std::string str_feature = "";
  77. for (size_t i = 0; i < feature.size; i++)
  78. {
  79. str_feature = str_feature + std::to_string(feature.data[i])+" ";
  80. }
  81. if (str_feature.length()>0)
  82. {
  83. str_feature.erase(str_feature.length() - 1);
  84. }
  85. std::string str = ("{\"center_x\":\"") + std::to_string(info.center_x) + ("\",") +
  86. "\"center_y\":\"" + std::to_string(info.center_y) + ("\",") +
  87. "\"width\":\"" + std::to_string(info.width) + ("\",") +
  88. "\"height\":\"" + std::to_string(info.height) + ("\",") +
  89. "\"score\":\"" + std::to_string(info.score) + "\","+
  90. "\"feature\":\"" + str_feature + "\"" +
  91. "}";
  92. res_str = res_str + str.c_str();
  93. res_str += ",";
  94. }
  95. if (res_str.length()>0)
  96. {
  97. res_str.erase(res_str.length() - 1);
  98. }
  99. res_str = "[" + res_str + "]";
  100. strcpy(json_result, res_str.c_str());
  101. return face_num;
  102. }
  103. // 人脸比对(通过传图片)
  104. float __cdecl face_match_by_img(void* engine, Mat* image, Mat* image2) {
  105. BaiduFaceApi* _api = (BaiduFaceApi*)engine;
  106. // type 0: 表示rgb 人脸特征值 1:表示nir人脸特征值
  107. int type = 0;
  108. float score = _api->match(*image, *image2, type);
  109. std::cout << "face match score is:" << score << std::endl;
  110. return score;
  111. }

调用代码

using FaceService.Common;
using Newtonsoft.Json;
using OpenCvSharp;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Security.Cryptography;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace FaceService
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        static IntPtr engine;

        string image_path = "";
        string image_path2 = "";

        private void button1_Click(object sender, EventArgs e)
        {
            engine = Native.create();
            string model_path = Application.StartupPath + "\\face";
            textBox1.Text = "正在初始化,请稍后……";
            Application.DoEvents();
            int res = Native.init(engine, model_path, "");
            if (res == 0)
            {
                textBox1.Text = "初始化成功!";
                MessageBox.Show("初始化成功");
            }
            else
            {
                textBox1.Text = "初始化失败,code:" + res;
                MessageBox.Show("初始化失败,code:" + res);
            }
        }

        ///


        /// 人脸检测
        ///

        ///
        ///
        private void button2_Click(object sender, EventArgs e)
        {
            if (engine == IntPtr.Zero)
            {
                MessageBox.Show("请先初始化!");
                return;
            }

            if (image_path == "")
            {
                MessageBox.Show("请先选择图片!");
                return;
            }
            textBox1.Text = "";
            if (pictureBox2.Image != null)
            {
                pictureBox2.Image.Dispose();
            }
            pictureBox2.Image = null;
            button2.Enabled = false;
            Application.DoEvents();

            Mat img = Cv2.ImRead(image_path);
            StringBuilder json_result = new StringBuilder(1024);
            int faceNum = Native.face_detect(engine, img.CvPtr, json_result);

            if (faceNum > 0)
            {
                textBox1.Text = json_result.ToString();
                // 将JSON字符串反序列化为对象
                FaceBox[] FaceBoxs = JsonConvert.DeserializeObject(json_result.ToString());
                for (int i = 0; i < FaceBoxs.Length; i++)
                {
                    FaceBox faceBox = FaceBoxs[i];
                    int x = (int)(faceBox.center_x - faceBox.width / 2);
                    int y = (int)(faceBox.center_y - faceBox.height / 2);
                    Rect rect = new Rect(x, y, (int)faceBox.width, (int)faceBox.height);
                    Cv2.PutText(img, faceBox.score.ToString("F2"), new OpenCvSharp.Point(x, y - 10), HersheyFonts.HersheySimplex, 1, Scalar.Red);
                    Cv2.Rectangle(img, rect, Scalar.Red);
                }
                pictureBox2.Image = new Bitmap(img.ToMemoryStream());
            }
            else
            {
                MessageBox.Show("未检测到人脸!");
            }
            button2.Enabled = true;
        }


        string fileFilter = "选择图片|*.bmp;*.jpg;*.jpeg;*.tiff;*.tiff;*.png";

        ///


        /// 选择图片
        ///

        ///
        ///
        private void button3_Click(object sender, EventArgs e)
        {
            OpenFileDialog ofd = new OpenFileDialog();
            ofd.InitialDirectory = Application.StartupPath + "\\test_img\\";
            ofd.Filter = fileFilter;

            if (ofd.ShowDialog() != DialogResult.OK) return;
            pictureBox1.Image = null;
            image_path = ofd.FileName;
            pictureBox1.Image = new Bitmap(image_path);
            textBox1.Text = "";
            pictureBox2.Image = null;

        }

        private void Form1_Load(object sender, EventArgs e)
        {
            image_path = "test_img\\2.jpg";
            pictureBox1.Image = new Bitmap(image_path);
        }

        ///


        /// 获取人脸特征值
        ///

        ///
        ///
        private void button4_Click(object sender, EventArgs e)
        {
            if (engine == IntPtr.Zero)
            {
                MessageBox.Show("请先初始化!");
                return;
            }

            if (image_path == "")
            {
                MessageBox.Show("请先选择图片!");
                return;
            }
            textBox1.Text = "";
            if (pictureBox2.Image != null)
            {
                pictureBox2.Image.Dispose();
            }
            pictureBox2.Image = null;
            button4.Enabled = false;
            Application.DoEvents();

            Mat img = Cv2.ImRead(image_path);
            StringBuilder json_result = new StringBuilder(2048);
            int faceNum = Native.face_feature(engine, img.CvPtr, json_result);

            if (faceNum > 0)
            {
                textBox1.Text = json_result.ToString();
            }
            else
            {
                MessageBox.Show("未检测到人脸!");
            }
            button4.Enabled = true;
        }

        ///


        /// 人脸比对
        ///

        ///
        ///
        private void button5_Click(object sender, EventArgs e)
        {
            if (engine == IntPtr.Zero)
            {
                MessageBox.Show("请先初始化!");
                return;
            }

            if (image_path == "")
            {
                MessageBox.Show("请先选择图片!");
                return;
            }

            if (image_path2 == "")
            {
                MessageBox.Show("请先选择图片!");
                return;
            }

            textBox1.Text = "";
            button5.Enabled = false;
            Application.DoEvents();

            Mat img = Cv2.ImRead(image_path);
            Mat img2 = Cv2.ImRead(image_path2);

            float match_score = Native.face_match_by_img(engine, img.CvPtr, img2.CvPtr);
            textBox1.Text = "match score:" + match_score.ToString("F2");
            button5.Enabled = true;
        }

        private void button6_Click(object sender, EventArgs e)
        {
            OpenFileDialog ofd = new OpenFileDialog();
            ofd.InitialDirectory = Application.StartupPath + "\\test_img\\";
            ofd.Filter = fileFilter;

            if (ofd.ShowDialog() != DialogResult.OK) return;
            image_path2 = ofd.FileName;
            pictureBox2.Image = null;
            pictureBox2.Image = new Bitmap(image_path2);
        }
    }
}

/*
 
 各接口返回结果 error_code 及 msg 信息如下:
错误码 错误内容 错误描述
0 SUCCESS 成功
-1 ILLEGAL_PARAMS 失败或非法参数
-2 MEMORY_ALLOCATION_FAILED 内存分配失败
-3 INSTANCE_IS_EMPTY 实例对象为空
-4 MODEL_IS_EMPTY 模型内容为空
-5 UNSUPPORT_ABILITY_TYPE 不支持的能力类型
-6 UNSUPPORT_INFER_TYPE 不支持的预测库类型
-7 NN_CREATE_FAILED 预测库对象创建失败
-8 NN_INIT_FAILED 预测库对象初始化失败
-9 IMAGE_IS_EMPTY 图像数据为空
-10 ABILITY_INIT_FAILED 人脸能力初始化失败
-11 ABILITY_UNLOAD 人脸能力未加载
-12 ABILITY_ALREADY_LOADED 人脸能力已加载
-13 NOT_AUTHORIZED 未授权
-14 ABILITY_RUN_EXCEPTION 人脸能力运行异常
-15 UNSUPPORT_IMAGE_TYPE 不支持的图像类型
-16 IMAGE_TRANSFORM_FAILED 图像转换失败
-1001 SYSTEM_ERROR 系统错误
-1002 PARARM_ERROR 参数错误
-1003 DB_OP_FAILED 数据库操作失败
-1004 NO_DATA 没有数据
-1005 RECORD_UNEXIST 记录不存在
-1006 RECORD_ALREADY_EXIST 记录已经存在
-1007 FILE_NOT_EXIST 文件不存在
-1008 GET_FEATURE_FAIL 提取特征值失败
-1009 FILE_TOO_BIG 文件太大
-1010 FACE_RESOURCE_NOT_EXIST 人脸资源文件不存在
-1011 FEATURE_LEN_ERROR 特征值长度错误
-1012 DETECT_NO_FACE 未检测到人脸
-1013 CAMERA_ERROR 摄像头错误或不存在
-1014 FACE_INSTANCE_ERROR 人脸引擎初始化错误
-1015 LICENSE_FILE_NOT_EXIST 授权文件不存在
-1016 LICENSE_KEY_EMPTY 授权序列号为空
-1017 LICENSE_KEY_INVALID 授权序列号无效
-1018 LICENSE_KEY_EXPIRE 授权序序列号过期
-1019 LICENSE_ALREADY_USED 授权序列号已被使用
-1020 DEVICE_ID_EMPTY 设备指纹为空
-1021 NETWORK_TIMEOUT 网络超时
-1022 NETWORK_ERROR 网络错误
-1023 CONF_INI_UNEXIST 配置 ini 文件不存在
-1024 WINDOWS_SERVER_ERROR 禁用在 Windows Server
 
 */

  1. using FaceService.Common;
  2. using Newtonsoft.Json;
  3. using OpenCvSharp;
  4. using System;
  5. using System.Collections.Generic;
  6. using System.ComponentModel;
  7. using System.Data;
  8. using System.Drawing;
  9. using System.Linq;
  10. using System.Security.Cryptography;
  11. using System.Text;
  12. using System.Threading.Tasks;
  13. using System.Windows.Forms;
  14. namespace FaceService
  15. {
  16. public partial class Form1 : Form
  17. {
  18. public Form1()
  19. {
  20. InitializeComponent();
  21. }
  22. static IntPtr engine;
  23. string image_path = "";
  24. string image_path2 = "";
  25. private void button1_Click(object sender, EventArgs e)
  26. {
  27. engine = Native.create();
  28. string model_path = Application.StartupPath + "\\face";
  29. textBox1.Text = "正在初始化,请稍后……";
  30. Application.DoEvents();
  31. int res = Native.init(engine, model_path, "");
  32. if (res == 0)
  33. {
  34. textBox1.Text = "初始化成功!";
  35. MessageBox.Show("初始化成功");
  36. }
  37. else
  38. {
  39. textBox1.Text = "初始化失败,code:" + res;
  40. MessageBox.Show("初始化失败,code:" + res);
  41. }
  42. }
  43. /// <summary>
  44. /// 人脸检测
  45. /// </summary>
  46. /// <param name="sender"></param>
  47. /// <param name="e"></param>
  48. private void button2_Click(object sender, EventArgs e)
  49. {
  50. if (engine == IntPtr.Zero)
  51. {
  52. MessageBox.Show("请先初始化!");
  53. return;
  54. }
  55. if (image_path == "")
  56. {
  57. MessageBox.Show("请先选择图片!");
  58. return;
  59. }
  60. textBox1.Text = "";
  61. if (pictureBox2.Image != null)
  62. {
  63. pictureBox2.Image.Dispose();
  64. }
  65. pictureBox2.Image = null;
  66. button2.Enabled = false;
  67. Application.DoEvents();
  68. Mat img = Cv2.ImRead(image_path);
  69. StringBuilder json_result = new StringBuilder(1024);
  70. int faceNum = Native.face_detect(engine, img.CvPtr, json_result);
  71. if (faceNum > 0)
  72. {
  73. textBox1.Text = json_result.ToString();
  74. // 将JSON字符串反序列化为对象
  75. FaceBox[] FaceBoxs = JsonConvert.DeserializeObject<FaceBox[]>(json_result.ToString());
  76. for (int i = 0; i < FaceBoxs.Length; i++)
  77. {
  78. FaceBox faceBox = FaceBoxs[i];
  79. int x = (int)(faceBox.center_x - faceBox.width / 2);
  80. int y = (int)(faceBox.center_y - faceBox.height / 2);
  81. Rect rect = new Rect(x, y, (int)faceBox.width, (int)faceBox.height);
  82. Cv2.PutText(img, faceBox.score.ToString("F2"), new OpenCvSharp.Point(x, y - 10), HersheyFonts.HersheySimplex, 1, Scalar.Red);
  83. Cv2.Rectangle(img, rect, Scalar.Red);
  84. }
  85. pictureBox2.Image = new Bitmap(img.ToMemoryStream());
  86. }
  87. else
  88. {
  89. MessageBox.Show("未检测到人脸!");
  90. }
  91. button2.Enabled = true;
  92. }
  93. string fileFilter = "选择图片|*.bmp;*.jpg;*.jpeg;*.tiff;*.tiff;*.png";
  94. /// <summary>
  95. /// 选择图片
  96. /// </summary>
  97. /// <param name="sender"></param>
  98. /// <param name="e"></param>
  99. private void button3_Click(object sender, EventArgs e)
  100. {
  101. OpenFileDialog ofd = new OpenFileDialog();
  102. ofd.InitialDirectory = Application.StartupPath + "\\test_img\\";
  103. ofd.Filter = fileFilter;
  104. if (ofd.ShowDialog() != DialogResult.OK) return;
  105. pictureBox1.Image = null;
  106. image_path = ofd.FileName;
  107. pictureBox1.Image = new Bitmap(image_path);
  108. textBox1.Text = "";
  109. pictureBox2.Image = null;
  110. }
  111. private void Form1_Load(object sender, EventArgs e)
  112. {
  113. image_path = "test_img\\2.jpg";
  114. pictureBox1.Image = new Bitmap(image_path);
  115. }
  116. /// <summary>
  117. /// 获取人脸特征值
  118. /// </summary>
  119. /// <param name="sender"></param>
  120. /// <param name="e"></param>
  121. private void button4_Click(object sender, EventArgs e)
  122. {
  123. if (engine == IntPtr.Zero)
  124. {
  125. MessageBox.Show("请先初始化!");
  126. return;
  127. }
  128. if (image_path == "")
  129. {
  130. MessageBox.Show("请先选择图片!");
  131. return;
  132. }
  133. textBox1.Text = "";
  134. if (pictureBox2.Image != null)
  135. {
  136. pictureBox2.Image.Dispose();
  137. }
  138. pictureBox2.Image = null;
  139. button4.Enabled = false;
  140. Application.DoEvents();
  141. Mat img = Cv2.ImRead(image_path);
  142. StringBuilder json_result = new StringBuilder(2048);
  143. int faceNum = Native.face_feature(engine, img.CvPtr, json_result);
  144. if (faceNum > 0)
  145. {
  146. textBox1.Text = json_result.ToString();
  147. }
  148. else
  149. {
  150. MessageBox.Show("未检测到人脸!");
  151. }
  152. button4.Enabled = true;
  153. }
  154. /// <summary>
  155. /// 人脸比对
  156. /// </summary>
  157. /// <param name="sender"></param>
  158. /// <param name="e"></param>
  159. private void button5_Click(object sender, EventArgs e)
  160. {
  161. if (engine == IntPtr.Zero)
  162. {
  163. MessageBox.Show("请先初始化!");
  164. return;
  165. }
  166. if (image_path == "")
  167. {
  168. MessageBox.Show("请先选择图片!");
  169. return;
  170. }
  171. if (image_path2 == "")
  172. {
  173. MessageBox.Show("请先选择图片!");
  174. return;
  175. }
  176. textBox1.Text = "";
  177. button5.Enabled = false;
  178. Application.DoEvents();
  179. Mat img = Cv2.ImRead(image_path);
  180. Mat img2 = Cv2.ImRead(image_path2);
  181. float match_score = Native.face_match_by_img(engine, img.CvPtr, img2.CvPtr);
  182. textBox1.Text = "match score:" + match_score.ToString("F2");
  183. button5.Enabled = true;
  184. }
  185. private void button6_Click(object sender, EventArgs e)
  186. {
  187. OpenFileDialog ofd = new OpenFileDialog();
  188. ofd.InitialDirectory = Application.StartupPath + "\\test_img\\";
  189. ofd.Filter = fileFilter;
  190. if (ofd.ShowDialog() != DialogResult.OK) return;
  191. image_path2 = ofd.FileName;
  192. pictureBox2.Image = null;
  193. pictureBox2.Image = new Bitmap(image_path2);
  194. }
  195. }
  196. }
  197. /*
  198. 各接口返回结果 error_code 及 msg 信息如下:
  199. 错误码 错误内容 错误描述
  200. 0 SUCCESS 成功
  201. -1 ILLEGAL_PARAMS 失败或非法参数
  202. -2 MEMORY_ALLOCATION_FAILED 内存分配失败
  203. -3 INSTANCE_IS_EMPTY 实例对象为空
  204. -4 MODEL_IS_EMPTY 模型内容为空
  205. -5 UNSUPPORT_ABILITY_TYPE 不支持的能力类型
  206. -6 UNSUPPORT_INFER_TYPE 不支持的预测库类型
  207. -7 NN_CREATE_FAILED 预测库对象创建失败
  208. -8 NN_INIT_FAILED 预测库对象初始化失败
  209. -9 IMAGE_IS_EMPTY 图像数据为空
  210. -10 ABILITY_INIT_FAILED 人脸能力初始化失败
  211. -11 ABILITY_UNLOAD 人脸能力未加载
  212. -12 ABILITY_ALREADY_LOADED 人脸能力已加载
  213. -13 NOT_AUTHORIZED 未授权
  214. -14 ABILITY_RUN_EXCEPTION 人脸能力运行异常
  215. -15 UNSUPPORT_IMAGE_TYPE 不支持的图像类型
  216. -16 IMAGE_TRANSFORM_FAILED 图像转换失败
  217. -1001 SYSTEM_ERROR 系统错误
  218. -1002 PARARM_ERROR 参数错误
  219. -1003 DB_OP_FAILED 数据库操作失败
  220. -1004 NO_DATA 没有数据
  221. -1005 RECORD_UNEXIST 记录不存在
  222. -1006 RECORD_ALREADY_EXIST 记录已经存在
  223. -1007 FILE_NOT_EXIST 文件不存在
  224. -1008 GET_FEATURE_FAIL 提取特征值失败
  225. -1009 FILE_TOO_BIG 文件太大
  226. -1010 FACE_RESOURCE_NOT_EXIST 人脸资源文件不存在
  227. -1011 FEATURE_LEN_ERROR 特征值长度错误
  228. -1012 DETECT_NO_FACE 未检测到人脸
  229. -1013 CAMERA_ERROR 摄像头错误或不存在
  230. -1014 FACE_INSTANCE_ERROR 人脸引擎初始化错误
  231. -1015 LICENSE_FILE_NOT_EXIST 授权文件不存在
  232. -1016 LICENSE_KEY_EMPTY 授权序列号为空
  233. -1017 LICENSE_KEY_INVALID 授权序列号无效
  234. -1018 LICENSE_KEY_EXPIRE 授权序序列号过期
  235. -1019 LICENSE_ALREADY_USED 授权序列号已被使用
  236. -1020 DEVICE_ID_EMPTY 设备指纹为空
  237. -1021 NETWORK_TIMEOUT 网络超时
  238. -1022 NETWORK_ERROR 网络错误
  239. -1023 CONF_INI_UNEXIST 配置 ini 文件不存在
  240. -1024 WINDOWS_SERVER_ERROR 禁用在 Windows Server
  241. */

天天代码码天天
微信公众号
.NET 人工智能实践
注:本文转载自blog.csdn.net的天天代码码天天的文章"https://lw112190.blog.csdn.net/article/details/140477844"。版权归原作者所有,此博客不拥有其著作权,亦不承担相应法律责任。如有侵权,请联系我们删除。
复制链接
复制链接
相关推荐
发表评论
登录后才能发表评论和回复 注册

/ 登录

评论记录:

未查询到任何数据!
回复评论:

分类栏目

后端 (14832) 前端 (14280) 移动开发 (3760) 编程语言 (3851) Java (3904) Python (3298) 人工智能 (10119) AIGC (2810) 大数据 (3499) 数据库 (3945) 数据结构与算法 (3757) 音视频 (2669) 云原生 (3145) 云平台 (2965) 前沿技术 (2993) 开源 (2160) 小程序 (2860) 运维 (2533) 服务器 (2698) 操作系统 (2325) 硬件开发 (2492) 嵌入式 (2955) 微软技术 (2769) 软件工程 (2056) 测试 (2865) 网络空间安全 (2948) 网络与通信 (2797) 用户体验设计 (2592) 学习和成长 (2593) 搜索 (2744) 开发工具 (7108) 游戏 (2829) HarmonyOS (2935) 区块链 (2782) 数学 (3112) 3C硬件 (2759) 资讯 (2909) Android (4709) iOS (1850) 代码人生 (3043) 阅读 (2841)

热门文章

101
推荐
关于我们 隐私政策 免责声明 联系我们
Copyright © 2020-2025 蚁人论坛 (iYenn.com) All Rights Reserved.
Scroll to Top