Face++人脸识别
来源:互联网 发布:战舰世界武藏数据 编辑:程序博客网 时间:2024/06/02 08:18
最近看到一个视频关于人脸识别,于是就测试了一番,千百度一番没有找到好的源码,
幸好Face++官方有源码,而且注释写的特别详细,我就研究了一天,终于皇天不负有心人,我成功的写出 了第一个人脸识别项目
这是部分代码:
String str=null; ByteArrayOutputStream output=null; FileImageInputStream input=null; byte bys[] = new byte[4000]; try { input = new FileImageInputStream(newFile(path)); output = new ByteArrayOutputStream(); byte[] buf = new byte[4000]; int numBytesRead = 0; while ((numBytesRead = input.read(buf)) != -1) { output.write(buf, 0, numBytesRead); } bys = output.toByteArray(); } catch (FileNotFoundException e1) { e1.printStackTrace(); System.err.println("系统找不到指定的路径"); } catch (IOException e) { e.printStackTrace(); } finally { try { output.close(); input.close(); } catch (Exception e2) { e2.printStackTrace(); } } /* *调用Face++接口CommonOperate对象需要传入三个参数 *第一个apiKey *第二个apiSecret *第三个isInternationalVersion 是否是使用国际版 *response.getStatus()返回状态码,状态这里可以查到 *https://console.faceplusplus.com.cn/documents/5672651 *response.getContent()返回参数,是字节数组,转成String输出JSON串 */ CommonOperate iOperate = new CommonOperate( "PDr8aqmZFWMvkFFtUNx_PFrbwi-j_Etx", "Ek54PzZn7au29e2TAUxlOzwOSfqNubps",false); try { Response response = iOperate.detectByte(bys,1,"gender,age,smiling,glass,headpose,blur"); if (response.getStatus()==200) { str = new String(response.getContent()); }else{ str = ""; } } catch (Exception e) { e.printStackTrace(); } return str; }源码已上传至github地址为:https://github.com/systemmin/Face.git
0 0
- face++人脸识别
- face++ 人脸识别
- Face++人脸识别
- Face++人脸识别
- face++实现人脸识别
- face++人脸识别源码
- 人脸识别应用face+
- face++实现人脸识别
- 人脸识别之Face++
- face ++ 实现人脸识别
- 人脸识别face recognition
- Face++ 人脸识别,身份识别集成
- Face++人脸识别:Learning Deep Face Representation
- face recognition matlab code 人脸识别
- face++人脸识别的java调用
- 人脸识别face++ SDK demo体验
- 人脸识别数据集 Face Databases
- 人脸识别(face recognition)
- C++知识点23
- Markdown初级教程-入门1
- 实验三:跟踪分析Linux内核的启动过程
- 决策树算法学习笔记
- 大数值和数组
- Face++人脸识别
- 第十二条 考虑实现Comparable接口
- OSTaskSuspend()
- C++中string转int
- About 'Scrovor'.
- 90:Best Time to Buy and Sell Stock II
- Andriod SDK Manager国内无法更新的解决方案
- 设计模式学习--适配器模式(类适配器和对象适配器)
- Axure之倒计时简单实现