当前位置: 首页 > news >正文

合肥做网站的的公司有哪些直播软件有哪些

合肥做网站的的公司有哪些,直播软件有哪些,外贸建设企业网站服务,西安网站建设市场虹软人脸识别&#xff1a; 虹软人脸识别的地址&#xff1a;虹软视觉开放平台—以免费人脸识别技术为核心的人脸识别算法开放平台 依赖包&#xff1a; 依赖包是从虹软开发平台下载的 在项目中引入这个依赖包 pom.xml <!-- 人脸识别 --><dependency><gr…

虹软人脸识别:

虹软人脸识别的地址:虹软视觉开放平台—以免费人脸识别技术为核心的人脸识别算法开放平台

依赖包:

依赖包是从虹软开发平台下载的

在项目中引入这个依赖包

pom.xml
<!--      人脸识别  --><dependency><groupId>com.arcsoft.face</groupId><artifactId>arcsoft-sdk-face</artifactId><version>2.2.0.1</version><scope>system</scope><systemPath>${project.basedir}/lib/arcsoft-sdk-face-3.0.0.0.jar</systemPath></dependency>

打包:

<configuration><includeSystemScope>true</includeSystemScope>
</configuration>

如图:

需要的参数:

#虹软人脸识别参数
arcsoft.appid=JC1YjvrZrVXtJTTw9d68Jpzi95FY5kNAM5r98wft11111
arcsoft.sdkKey=EAFuucMzSpKymeCYqYwg4UC3QBbbMeMnw7NZBNRt1111
#驱动
arcsoft.libPath=D:\\Java\\faceDrive  

驱动是需要引入代码中的

代码:
package com.example.tanhuanapp.server.impl;import com.arcsoft.face.EngineConfiguration;
import com.arcsoft.face.FaceEngine;
import com.arcsoft.face.FaceInfo;
import com.arcsoft.face.FunctionConfiguration;
import com.arcsoft.face.enums.DetectMode;
import com.arcsoft.face.enums.DetectOrient;
import com.arcsoft.face.enums.ErrorInfo;
import com.arcsoft.face.enums.ImageFormat;
import com.arcsoft.face.toolkit.ImageFactory;
import com.arcsoft.face.toolkit.ImageInfo;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import javax.annotation.PostConstruct;
import java.io.File;
import java.util.ArrayList;
import java.util.List;/*** @author IT空门_门主* @date 2024/1/11*/
@Slf4j
@Service
public class FaceEngineServiceImpl {@Value("${arcsoft.appid}")private String  appid;@Value("${arcsoft.sdkKey}")private String  sdkKey;@Value("${arcsoft.libPath}")private String  libPath;private FaceEngine faceEngine;/***  初始化引擎*/@PostConstructpublic void init() {// 激活并且初始化引擎FaceEngine faceEngine = new FaceEngine(libPath);int activeCode = faceEngine.activeOnline(appid, sdkKey);if (activeCode != ErrorInfo.MOK.getValue() && activeCode != ErrorInfo.MERR_ASF_ALREADY_ACTIVATED.getValue()) {log.error("引擎激活失败");throw new RuntimeException("引擎激活失败");}//引擎配置EngineConfiguration engineConfiguration = new EngineConfiguration();//IMAGE检测模式,用于处理单张的图像数据engineConfiguration.setDetectMode(DetectMode.ASF_DETECT_MODE_IMAGE);//人脸检测角度,逆时针0度engineConfiguration.setDetectFaceOrientPriority(DetectOrient.ASF_OP_0_ONLY);//功能配置FunctionConfiguration functionConfiguration = new FunctionConfiguration();functionConfiguration.setSupportAge(true);functionConfiguration.setSupportFace3dAngle(true);functionConfiguration.setSupportFaceDetect(true);functionConfiguration.setSupportFaceRecognition(true);functionConfiguration.setSupportGender(true);functionConfiguration.setSupportLiveness(true);functionConfiguration.setSupportIRLiveness(true);engineConfiguration.setFunctionConfiguration(functionConfiguration);//初始化引擎int initCode = faceEngine.init(engineConfiguration);if (initCode != ErrorInfo.MOK.getValue()) {log.error("初始化引擎出错!");throw new RuntimeException("初始化引擎出错!");}this.faceEngine = faceEngine;}/*** 检测图片是否为人像** @param imageInfo 图像对象* @return true:人像,false:非人像*/public boolean checkIsPortrait(ImageInfo imageInfo) {// 定义人脸列表List<FaceInfo> faceInfoList = new ArrayList<FaceInfo>();faceEngine.detectFaces(imageInfo.getImageData(), imageInfo.getWidth(), imageInfo.getHeight(), ImageFormat.CP_PAF_BGR24, faceInfoList);log.info("检测到人脸数量:{}",faceInfoList.size());log.info("检测:{}",faceInfoList);return !faceInfoList.isEmpty();}/***上传图片接口(byte[])* @param imageData* @return*/public boolean checkIsPortrait(byte[] imageData) {return this.checkIsPortrait(ImageFactory.getRGBData(imageData));}/*** 上传图片接口(file)* @param file* @return*/public boolean checkIsPortrait(File file) {return this.checkIsPortrait(ImageFactory.getRGBData(file));}
}

测试:

package com.example.tanhuanapp;import com.arcsoft.face.*;
import com.arcsoft.face.enums.DetectMode;
import com.arcsoft.face.enums.DetectModel;
import com.arcsoft.face.enums.DetectOrient;
import com.arcsoft.face.enums.ErrorInfo;
import com.arcsoft.face.toolkit.ImageInfo;
import com.arcsoft.face.toolkit.ImageInfoEx;
import com.example.tanhuanapp.server.impl.FaceEngineServiceImpl;
import lombok.extern.slf4j.Slf4j;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import java.io.File;
import java.util.ArrayList;
import java.util.List;
import static com.arcsoft.face.toolkit.ImageFactory.getGrayData;
import static com.arcsoft.face.toolkit.ImageFactory.getRGBData;/*** @author IT空门_门主* @date 2024/1/11*/
@Slf4j
@SpringBootTest
public class FaceRecognition {@Autowiredprivate FaceEngineServiceImpl faceEngineService;/*** 测试人脸识别*/@Testpublic void testCheckIsPortrait(){File file = new File("C:\\Users\\DELL\\Desktop\\aa\\1.jpg");boolean checkIsPortrait = this.faceEngineService.checkIsPortrait(file);System.out.println(checkIsPortrait); // true|false}@Testvoid contextLoads() {//从官网获取String appId = "JC1YjvrZrVXtJTTw9d68Jpzi95FY5kNAM5r98wftenQU";String sdkKey = "EAFuucMzSpKymeCYqYwg4UC3QBbbMeMnw7NZBNRtcGco";FaceEngine faceEngine = new FaceEngine("D:\\Java\\faceDrive");log.info("faceEngine:{}",faceEngine);//激活引擎int errorCode = faceEngine.activeOnline(appId, sdkKey);if (errorCode != ErrorInfo.MOK.getValue() && errorCode != ErrorInfo.MERR_ASF_ALREADY_ACTIVATED.getValue()) {System.out.println("引擎激活失败");}ActiveFileInfo activeFileInfo=new ActiveFileInfo();errorCode = faceEngine.getActiveFileInfo(activeFileInfo);if (errorCode != ErrorInfo.MOK.getValue() && errorCode != ErrorInfo.MERR_ASF_ALREADY_ACTIVATED.getValue()) {System.out.println("获取激活文件信息失败");}//引擎配置EngineConfiguration engineConfiguration = new EngineConfiguration();engineConfiguration.setDetectMode(DetectMode.ASF_DETECT_MODE_IMAGE);engineConfiguration.setDetectFaceOrientPriority(DetectOrient.ASF_OP_ALL_OUT);engineConfiguration.setDetectFaceMaxNum(10);engineConfiguration.setDetectFaceScaleVal(16);//功能配置FunctionConfiguration functionConfiguration = new FunctionConfiguration();functionConfiguration.setSupportAge(true);functionConfiguration.setSupportFace3dAngle(true);functionConfiguration.setSupportFaceDetect(true);functionConfiguration.setSupportFaceRecognition(true);functionConfiguration.setSupportGender(true);functionConfiguration.setSupportLiveness(true);functionConfiguration.setSupportIRLiveness(true);engineConfiguration.setFunctionConfiguration(functionConfiguration);//初始化引擎errorCode = faceEngine.init(engineConfiguration);if (errorCode != ErrorInfo.MOK.getValue()) {System.out.println("初始化引擎失败");}//人脸检测ImageInfo imageInfo = getRGBData(new File("C:\\Users\\DELL\\Desktop\\aa\\21.jpg"));List<FaceInfo> faceInfoList = new ArrayList<FaceInfo>();errorCode = faceEngine.detectFaces(imageInfo.getImageData(), imageInfo.getWidth(), imageInfo.getHeight(), imageInfo.getImageFormat(), faceInfoList);System.out.println(faceInfoList);log.info("人脸检测接口返回值为{}", faceInfoList);//特征提取FaceFeature faceFeature = new FaceFeature();errorCode = faceEngine.extractFaceFeature(imageInfo.getImageData(), imageInfo.getWidth(), imageInfo.getHeight(), imageInfo.getImageFormat(), faceInfoList.get(0), faceFeature);System.out.println("特征值大小:" + faceFeature.getFeatureData().length);//人脸检测2ImageInfo imageInfo2 = getRGBData(new File("C:\\Users\\DELL\\Desktop\\aa\\21.jpg"));List<FaceInfo> faceInfoList2 = new ArrayList<FaceInfo>();errorCode = faceEngine.detectFaces(imageInfo2.getImageData(), imageInfo2.getWidth(), imageInfo2.getHeight(),imageInfo2.getImageFormat(), faceInfoList2);System.out.println(faceInfoList2);//特征提取2FaceFeature faceFeature2 = new FaceFeature();errorCode = faceEngine.extractFaceFeature(imageInfo2.getImageData(), imageInfo2.getWidth(), imageInfo2.getHeight(), imageInfo2.getImageFormat(), faceInfoList2.get(0), faceFeature2);System.out.println("特征值大小:" + faceFeature2.getFeatureData().length);//特征比对FaceFeature targetFaceFeature = new FaceFeature();targetFaceFeature.setFeatureData(faceFeature.getFeatureData());FaceFeature sourceFaceFeature = new FaceFeature();sourceFaceFeature.setFeatureData(faceFeature2.getFeatureData());FaceSimilar faceSimilar = new FaceSimilar();errorCode = faceEngine.compareFaceFeature(targetFaceFeature, sourceFaceFeature, faceSimilar);System.out.println("相似度:" + faceSimilar.getScore());//设置活体测试errorCode = faceEngine.setLivenessParam(0.5f, 0.7f);//人脸属性检测FunctionConfiguration configuration = new FunctionConfiguration();configuration.setSupportAge(true);configuration.setSupportFace3dAngle(true);configuration.setSupportGender(true);configuration.setSupportLiveness(true);errorCode = faceEngine.process(imageInfo.getImageData(), imageInfo.getWidth(), imageInfo.getHeight(), imageInfo.getImageFormat(), faceInfoList, configuration);//性别检测List<GenderInfo> genderInfoList = new ArrayList<GenderInfo>();errorCode = faceEngine.getGender(genderInfoList);System.out.println("性别:" + genderInfoList.get(0).getGender());//年龄检测List<AgeInfo> ageInfoList = new ArrayList<AgeInfo>();errorCode = faceEngine.getAge(ageInfoList);System.out.println("年龄:" + ageInfoList.get(0).getAge());//3D信息检测List<Face3DAngle> face3DAngleList = new ArrayList<Face3DAngle>();errorCode = faceEngine.getFace3DAngle(face3DAngleList);System.out.println("3D角度:" + face3DAngleList.get(0).getPitch() + "," + face3DAngleList.get(0).getRoll() + "," + face3DAngleList.get(0).getYaw());//活体检测List<LivenessInfo> livenessInfoList = new ArrayList<LivenessInfo>();errorCode = faceEngine.getLiveness(livenessInfoList);System.out.println("活体:" + livenessInfoList.get(0).getLiveness());//IR属性处理ImageInfo imageInfoGray = getGrayData(new File("C:\\Users\\DELL\\Desktop\\aa\\21.jpg"));List<FaceInfo> faceInfoListGray = new ArrayList<FaceInfo>();errorCode = faceEngine.detectFaces(imageInfoGray.getImageData(), imageInfoGray.getWidth(), imageInfoGray.getHeight(), imageInfoGray.getImageFormat(), faceInfoListGray);FunctionConfiguration configuration2 = new FunctionConfiguration();configuration2.setSupportIRLiveness(true);errorCode = faceEngine.processIr(imageInfoGray.getImageData(), imageInfoGray.getWidth(), imageInfoGray.getHeight(), imageInfoGray.getImageFormat(), faceInfoListGray, configuration2);//IR活体检测List<IrLivenessInfo> irLivenessInfo = new ArrayList<>();errorCode = faceEngine.getLivenessIr(irLivenessInfo);System.out.println("IR活体:" + irLivenessInfo.get(0).getLiveness());ImageInfoEx imageInfoEx = new ImageInfoEx();imageInfoEx.setHeight(imageInfo.getHeight());imageInfoEx.setWidth(imageInfo.getWidth());imageInfoEx.setImageFormat(imageInfo.getImageFormat());imageInfoEx.setImageDataPlanes(new byte[][]{imageInfo.getImageData()});imageInfoEx.setImageStrides(new int[]{imageInfo.getWidth() * 3});List<FaceInfo> faceInfoList1 = new ArrayList<>();errorCode = faceEngine.detectFaces(imageInfoEx, DetectModel.ASF_DETECT_MODEL_RGB, faceInfoList1);FunctionConfiguration fun = new FunctionConfiguration();fun.setSupportAge(true);errorCode = faceEngine.process(imageInfoEx, faceInfoList1, functionConfiguration);List<AgeInfo> ageInfoList1 = new ArrayList<>();int age = faceEngine.getAge(ageInfoList1);System.out.println("年龄:" + ageInfoList1.get(0).getAge());FaceFeature feature = new FaceFeature();errorCode = faceEngine.extractFaceFeature(imageInfoEx, faceInfoList1.get(0), feature);//引擎卸载errorCode = faceEngine.unInit();}
}
http://www.15wanjia.com/news/164258.html

相关文章:

  • 西安网站建设费用飞飞cms悠悠电影网站
  • 高端品牌网站设计公司价格中国住房城乡建设部网站
  • 网站维护合同范本响应式网站区别
  • 深圳提供网站建设服务平台做模具在哪个网站找工作
  • 苏州网站建设老板泰安网页设计招聘
  • 用discuz做行业网站做网站背景的图片大小
  • 哈尔滨市做网站wordpress主题授权
  • 佛山哪家网站建设比较好手机网站建设推广方案
  • server 2012 做网站网页设计实训报告实训小结
  • 网站建设第一步互联网公司排名中国2022
  • 宁夏建设厅网站公示网站建设如何吸引投资
  • 莱芜网站建设案例专注网站建设公司
  • 长沙网站建设商城贸易型企业网站建设
  • ip地址做网站做网站前台用什么问题
  • 最权威的做网站优化价格怎样做好网络推广工作
  • 网站弄论坛形式怎么做用asp怎么做网站
  • 网站页面设计 颜色 背景 要求服装网站建设分析
  • 公司做网站 手机 电脑合肥网站制作费用
  • 河南实力网站建设首选不是万维网的网站
  • 建设一个地方门户网站做网站的属于什么
  • 徐州专业网站seo扬中网
  • 完整网站开发教程什么网站了解国家建设的行情
  • 微网站开发框架wordpress文件默认权限设置
  • 烟台市做网站的价格如何在阿里云上建设网站
  • 建教会网站的内容东昌府网站建设公司
  • 大港网站开发写轮眼python代码
  • 无锡集团网站建设公司新能源汽车价格补贴
  • wordpress个人建站教程网站建设知识产权问题
  • 浙江网站建设报价企业咨询服务合同范本
  • 思明自助建站软件长沙0731房地产网