首页 > 系统相关 >百度人脸识别Windows C++离线sdk C#接入

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

时间:2024-07-18 23:27:25浏览次数:9  
标签:engine 人脸识别 img Windows image 离线 int 人脸 path

百度人脸识别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 包结构

效果

代码

头文件

#pragma once

#include "targetver.h"

#define WIN32_LEAN_AND_MEAN             // 从 Windows 头中排除极少使用的资料
// Windows 头文件: 
#include <windows.h>
#include "baidu_face_api.h"
#include <iostream>
#include <opencv2/opencv.hpp>

using namespace std;
using namespace cv;

//创建实例
extern "C" _declspec(dllexport) void* __cdecl create();

//实例初始化
extern "C" _declspec(dllexport) int __cdecl init(void* engine, char* model_path, char* code);

//人脸检测
extern "C" _declspec(dllexport) int __cdecl face_detect(void* engine, Mat* image, char* json_result);

// 通过图片人脸特征值提取
extern "C" _declspec(dllexport) int __cdecl face_feature(void* engine, Mat* image, char* json_result);

// 人脸比对(通过传图片)
extern "C" _declspec(dllexport) float __cdecl face_match_by_img(void* engine, Mat* image, Mat* image2);

源文件

#include "stdafx.h"

BaiduFaceApi *api;

//创建实例
void* __cdecl create() {

   api = new BaiduFaceApi();

   // 获取设备指纹
   std::string device_id;
   api->get_device_id(device_id);
   std::cout << "device id is:" << device_id << std::endl;

   // 获取sdk版本号
   std::string version;
   api->sdk_version(version);
   std::cout << "sdk version:" << version << std::endl;

   return api;
}

//实例初始化
int __cdecl init(void* engine, char* model_path, char* code) {

	BaiduFaceApi* _api = (BaiduFaceApi*)engine;
	return (int)_api->sdk_init(model_path);

}

//人脸检测
int __cdecl face_detect(void* engine, Mat* image, char* json_result) {

	BaiduFaceApi* _api = (BaiduFaceApi*)engine;

	std::vector<FaceBox> box_list;
	// type 0: 表示rgb 人脸检测 1:表示nir人脸检测
	int type = 0;
	int face_num = 0;

	face_num = _api->detect(box_list, image, 0);

	std::cout << "-----face_num  is-------" << face_num << std::endl;

	std::string res_str("");

	if (face_num > 0)
	{
		for (int i = 0; i < face_num; i++)
		{
			FaceBox info = box_list.at(i);
			// 人脸置信度
			std::cout << "detect score is:" << info.score << std::endl;
			// 人脸宽度
			std::cout << "detect mWidth is:" << info.width << std::endl;
			// 中心点X,Y坐标
			std::cout << "detect mCenter_x is:" << info.center_x << std::endl;
			std::cout << "detect mCenter_y is:" << info.center_y << std::endl;

			std::string str = ("{\"center_x\":\"") + std::to_string(info.center_x) + ("\",") +
				"\"center_y\":\"" + std::to_string(info.center_y) + ("\",") +
				"\"width\":\"" + std::to_string(info.width) + ("\",") +
				"\"height\":\"" + std::to_string(info.height) + ("\",") +
				"\"score\":\"" + std::to_string(info.score) + "\"}";

			res_str = res_str + str.c_str();
			res_str += ",";
		}
	}

	if (res_str.length()>0)
	{
		res_str.erase(res_str.length() - 1);
	}
	res_str = "[" + res_str + "]";

	strcpy(json_result, res_str.c_str());

	return face_num;

}

// 通过图片人脸特征值提取
int __cdecl face_feature(void* engine, Mat* image, char* json_result) {

	BaiduFaceApi* _api = (BaiduFaceApi*)engine;

	std::vector<Feature> out_fea1;
	std::vector<FaceBox> out_box1;
	// 提取第一个人的特征值
	// 特征值的type:传 0 可见光生活照特征值, 1、表示近红外特征值
	int type = 0;
	int face_num = 0;
	face_num = _api->face_feature(out_fea1, out_box1, image, type);
	std::cout << "face num is:" << face_num << std::endl;
	int size = out_fea1.size();

	std::string res_str("");

	for (int i = 0; i < size; i++) {
		Feature feature = out_fea1.at(i);
		FaceBox info = out_box1.at(i);

		std::string str_feature = "";
		for (size_t i = 0; i < feature.size; i++)
		{
			str_feature = str_feature + std::to_string(feature.data[i])+" ";
		}

		if (str_feature.length()>0)
		{
			str_feature.erase(str_feature.length() - 1);
		}

		std::string str = ("{\"center_x\":\"") + std::to_string(info.center_x) + ("\",") +
			"\"center_y\":\"" + std::to_string(info.center_y) + ("\",") +
			"\"width\":\"" + std::to_string(info.width) + ("\",") +
			"\"height\":\"" + std::to_string(info.height) + ("\",") +
			"\"score\":\"" + std::to_string(info.score) + "\","+
			"\"feature\":\"" + str_feature + "\"" +
		    "}";

		res_str = res_str + str.c_str();
		res_str += ",";

	}

	if (res_str.length()>0)
	{
		res_str.erase(res_str.length() - 1);
	}
	res_str = "[" + res_str + "]";

	strcpy(json_result, res_str.c_str());

	return face_num;
}

// 人脸比对(通过传图片)
float __cdecl face_match_by_img(void* engine, Mat* image, Mat* image2) {

	BaiduFaceApi* _api = (BaiduFaceApi*)engine;
	// type 0: 表示rgb 人脸特征值 1:表示nir人脸特征值
	int type = 0;
	float score = _api->match(*image, *image2, type);
	std::cout << "face match score is:" << score << std::endl;
	return score;
}

调用代码

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);
            }
        }

        /// <summary>
        /// 人脸检测
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        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<FaceBox[]>(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";

        /// <summary>
        /// 选择图片
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        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);
        }

        /// <summary>
        /// 获取人脸特征值
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        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;
        }

        /// <summary>
        /// 人脸比对
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        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
 
 */

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);
            }
        }

        /// <summary>
        /// 人脸检测
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        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<FaceBox[]>(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";

        /// <summary>
        /// 选择图片
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        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);
        }

        /// <summary>
        /// 获取人脸特征值
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        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;
        }

        /// <summary>
        /// 人脸比对
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        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
 
 */

标签:engine,人脸识别,img,Windows,image,离线,int,人脸,path
From: https://blog.csdn.net/weixin_46771779/article/details/140520043

相关文章

  • Windows虚拟摄像头有哪些?分享5个方法,手机一键替换电脑摄像头!
    Windows虚拟摄像头怎么用?当我们的电脑缺少摄像头时,我们可以借助虚拟摄像头实现。手机作为电脑摄像头的需求日益增长,本文就来给大家详细介绍,关于电脑虚拟摄像头的使用和说明,一起来看看吧!(一)常见的Windows虚拟摄像头软件推荐金虚拟摄像头:支持WiFi/USB/IP多种连接方式,即开即连。......
  • 在Python中doc转docx,xls转xlsx,ppt转pptx(Windows)
    在Python中doc转docx,xls转xlsx,ppt转pptx(Windows)说明:首次发表日期:2024-07-18参考pypi包:doc2docx缘起我们一般使用Python开发RAG应用,或者使用基于Python开发的开源RAG工具,比如Dify。然而由于Python中对.doc和.ppt格式的文件支持不够好,通常我们需要将文件格式转换为.docx和.p......
  • 操作系统发展简史(Unix/Linux 篇 + DOS/Windows 篇)+ Mac 与 Microsoft 之风云争霸
    操作系统发展简史(Unix/Linux篇)说到操作系统,大家都不会陌生。我们天天都在接触操作系统——用台式机或笔记本电脑,使用的是windows和macOS系统;用手机、平板电脑,则是android(安卓)和iOS系统。如果是从事信息通信行业,还经常会和ubuntu、CentOS、Fedora这样的Linux......
  • Kafka在Windows和CentOS的安装实践
    一、什么是kafka?Apachekafkaisadistributedstreamingplatform,即官方定义 kafka是一个分布式流式计算平台。而在大部分企业开发人员中,都是把kafka当成消息系统使用,即它是一个分布式消息队列。Kafka也是一个分布式的基于发布/订阅模式的消息队列(MessageQueue),主要应......
  • # Windows 定时删除指定路径下N天前的日志文件
    Windows下bat脚本文件的内容为1.删除指定路径下5天前的所有文件@echooffsetSrcDir=E:\WORK\GitsetDaysAgo=5forfiles/p%SrcDir%/s/m*.*/d-%DaysAgo%/c"cmd/cdel/f/q/a@path"2.删除指定路径下5天前的所有log文件@echooffsetSrcDir=E:\WORK\Git//指......
  • Windows 11开始菜单变了!应用分类显示 更好找
    Windows11重新设计了开始菜单,虽然备受争议,但其实也挺好用的,只是有一个槽点,安装了太多应用软件之后,滚动列表会非常长,很难找到自己需要的。在最新的Windows1122635.3930测试版本中,微软隐藏了一个新功能,尝试重新设计开始菜单的应用列表,增加了一个“类别”(Category)模式。在这......
  • 分析nirsoft出品的几个日志查看工具 windows
    介绍官网https://www.nirsoft.net/包含lastactivityview(程序打开日志查看)、turnedontimesview(系统开关机日志)、winlogonview(系统登陆日志查看)以上三个均为个人经常使用,并已经打好中文补丁。均为绿色免安装版本,解压直接食用。打包下载下载:https://damon8.lanzoub.com/izGOX2......
  • 使用ventoy安装windows10
    使用ventoy安装windows10在ventoy中选择windows10镜像进入Windows安装界面下一步,选择现在安装稍等片刻选择我没有产品密钥根据需求选择对应版本下一步,接受许可条款下一步,选择自定义选择安装位置注意:我这里只有一块硬盘,且没有分区,直接选择下一步即可。安装程序......
  • Windows入门
    1.隐藏和显示控制台窗口WM_SYSCOMMAND:系统命令消息。SC_MINIMIZE:将窗口最小化。SC_RESTORE:将窗口还原。#include<windows.h>intmain(){HWNDhWnd=GetConsoleWindow();::SendMessage(hWnd,WM_SYSCOMMAND,SC_MINIMIZE,NULL);//程序运行至此处后,控制台......
  • linux系统和windows系统如何同步时间,服务器时间变动怎么同步
    一、Linux系统时间同步1.使用NTP(网络时间协议)NTP是最常用的Linux系统时间同步方式。NTP通过连接到外部时间服务器(如原子钟或GPS接收器)来获取高精度的时间信息,并校准本地系统时间。步骤:安装NTP客户端:在Ubuntu系统上,可以使用命令sudoapt-getinstallntp安装NTP客户端......