1. 程式人生 > >AI-人工智能/機器學習 seetafaceJNI

AI-人工智能/機器學習 seetafaceJNI

div ota cer 項目 com 文件 afa idle 依賴庫

基於中科院seetaface2進行封裝的JAVA人臉識別庫,支持人臉識別、1:1比對、1:N比對。

項目介紹

基於中科院seetaface2進行封裝的JAVA人臉識別算法庫,支持人臉識別、1:1比對、1:N比對。 seetaface2:https://github.com/seetaface/SeetaFaceEngine2

環境配置

1、下載model( https://pan.baidu.com/s/1HJj8PEnv3SOu6ZxVpAHPXg ) 文件到本地,並解壓出來;

2、下載doc目錄中對應的lib包到本地並解壓:Windows(64位)環境下載lib-win-x64.zip、Linux(64位)下載lib-linux-x64.tar.bz2,Linux環境還需要安裝依賴庫,詳見:https://my.oschina.net/u/1580184/blog/3042404 ;

3、將doc中的faces-data.db下載到本地;(PS:如果不需要使用1:N人臉搜索,不需要此文件,需要將seetafce.properties中的sqlite.db.file配置註釋掉);

4、將src/main/resources/中的seetaface.properties文件放到項目的resources根目錄中;

#linux系統中依賴的lib名稱
libs=holiday,SeetaFaceDetector200,SeetaPointDetector200,SeetaFaceRecognizer200,SeetaFaceCropper200,SeetaFace2JNI
#Windows系統中依賴的lib名稱
#libs=libgcc_s_sjlj-1,libeay32,libquadmath-0,ssleay32,libgfortran-3,libopenblas,holiday,SeetaFaceDetector200,SeetaPointDetector200,SeetaFaceRecognizer200,SeetaFaceCropper200,SeetaFace2JNI

#lib存放目錄
libs.path=/usr/local/seetaface2/lib
#model存放目錄
bindata.dir=/usr/local/seetaface2/bindata

##sqlite配置(如果不用1:N人臉搜索功能,請刪除下面5項sqlite開頭的配置)
sqlite.db.file=/data/faces-data.db
sqlite.conn.maxTotal=50
sqlite.conn.maxIdle=5
sqlite.conn.minIdle=0
sqlite.conn.maxWaitMillis=60000

5、將seetafaceJNI-2.0.jar和依賴包導入到項目中,pom如下:

   <properties>
       <spring.version>4.2.8.RELEASE</spring.version>
       <log4j.version>2.8.2</log4j.version>
       <slf4j.version>1.7.25</slf4j.version>
   </properties>
  
   <dependencies>
       <dependency>
            <groupId>com.cnsugar.ai</groupId>
            <artifactId>seetafaceJNI</artifactId>
            <version>2.0</version>
            <!--<scope>system</scope>-->
            <!--<systemPath>${project.basedir}/lib/seetafaceJNI-2.0.jar</systemPath>-->
       </dependency>
       <dependency>
           <groupId>org.springframework</groupId>
           <artifactId>spring-core</artifactId>
           <version>${spring.version}</version>
       </dependency>
  
       <dependency>
           <groupId>org.slf4j</groupId>
           <artifactId>slf4j-api</artifactId>
           <version>${slf4j.version}</version>
       </dependency>
  
       <!-- sqlite -->
       <dependency>
           <groupId>org.xerial</groupId>
           <artifactId>sqlite-jdbc</artifactId>
           <version>3.25.2</version>
       </dependency>
       <dependency>
           <groupId>org.apache.commons</groupId>
           <artifactId>commons-pool2</artifactId>
           <version>2.4.2</version>
       </dependency>
   </dependencies> 

6、調用FaceHelper中的方法。

AI-人工智能/機器學習 seetafaceJNI