精华内容
下载资源
问答
  • 1、阿里人脸对比和百度人脸对比区别: 阿里1元一个月调用100次 百度2人同时调用接口为免费,多人调用接口则需付费。 阿里人脸对比代码 faceBomparisonALi.action类 package ideal4j.leisure.platform.bwyd....

    1、阿里人脸对比和百度人脸对比区别:
    阿里1元一个月调用100次
    百度2人同时调用接口为免费,多人调用接口则需付费。

    阿里人脸对比代码

    faceBomparisonALi.action类
    package ideal4j.leisure.platform.bwyd.faceBomparisonALi.action;
    
    import java.util.HashMap;
    import java.util.Map;
    
    import org.apache.http.HttpResponse;
    import org.apache.http.util.EntityUtils;
    
    import ideal4j.leisure.platform.bwyd.faceBomparisonALi.service.HttpUtils;
    import ideal4j.leisure.platform.bwyd.faceBomparisonALi.service.Img2Base64Util;
    
    public class FaceBomparisonALiAction {
    
    	public static void main(String[] args) {
    		String host = "https://face.xiaohuaerai.com";
    	    String path = "/face";
    	    String method = "POST";
    	    String appcode = "1111111111111111111111111111111111111";
    	    Map<String, String> headers = new HashMap<String, String>();
    	    //最后在header中的格式(中间是英文空格)为Authorization:APPCODE 83359fd73fe94948385f570e3c139105
    	    headers.put("Authorization", "APPCODE " + appcode);
    	    //根据API的要求,定义相对应的Content-Type
    	    headers.put("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8");
    	    Map<String, String> querys = new HashMap<String, String>();
    	    Map<String, String> bodys = new HashMap<String, String>();
    	    bodys.put("srca", Img2Base64Util.GetImageStrs("E:/人脸对比/男b.png"));
    	    bodys.put("srcb", Img2Base64Util.GetImageStrs("E:/人脸对比/女b.png"));
    	    bodys.put("type", "LIVE");
    
    
    	    try {
    	    	/**
    	    	* 重要提示如下:
    	    	* HttpUtils请从
    	    	* https://github.com/aliyun/api-gateway-demo-sign-java/blob/master/src/main/java/com/aliyun/api/gateway/demo/util/HttpUtils.java
    	    	* 下载
    	    	*
    	    	* 相应的依赖请参照
    	    	* https://github.com/aliyun/api-gateway-demo-sign-java/blob/master/pom.xml
    	    	*/
    	    	HttpResponse response = HttpUtils.doPost(host, path, method, headers, querys, bodys);
    	    	System.out.println("???"+response.toString());
    	    	//获取response的body
    	    	System.out.println(EntityUtils.toString(response.getEntity()));
    	    } catch (Exception e) {
    	    	e.printStackTrace();
    	    }
    
    	}
    	
    }
    
    HttpUtils类
    
    ```java
    package ideal4j.leisure.platform.bwyd.faceBomparisonALi.service;
    
    import java.io.UnsupportedEncodingException;
    import java.net.URLEncoder;
    import java.security.KeyManagementException;
    import java.security.NoSuchAlgorithmException;
    import java.security.cert.X509Certificate;
    import java.util.ArrayList;
    import java.util.List;
    import java.util.Map;
    
    import javax.net.ssl.SSLContext;
    import javax.net.ssl.TrustManager;
    import javax.net.ssl.X509TrustManager;
    
    import org.apache.commons.lang.StringUtils;
    import org.apache.http.HttpResponse;
    import org.apache.http.NameValuePair;
    import org.apache.http.client.HttpClient;
    import org.apache.http.client.entity.UrlEncodedFormEntity;
    import org.apache.http.client.methods.HttpDelete;
    import org.apache.http.client.methods.HttpGet;
    import org.apache.http.client.methods.HttpPost;
    import org.apache.http.client.methods.HttpPut;
    import org.apache.http.conn.ClientConnectionManager;
    import org.apache.http.conn.scheme.Scheme;
    import org.apache.http.conn.scheme.SchemeRegistry;
    import org.apache.http.conn.ssl.SSLSocketFactory;
    import org.apache.http.entity.ByteArrayEntity;
    import org.apache.http.entity.StringEntity;
    import org.apache.http.impl.client.DefaultHttpClient;
    import org.apache.http.message.BasicNameValuePair;
    
    public class HttpUtils {
    	
    	/**
    	 * get
    	 * 
    	 * @param host
    	 * @param path
    	 * @param method
    	 * @param headers
    	 * @param querys
    	 * @return
    	 * @throws Exception
    	 */
    	public static HttpResponse doGet(String host, String path, String method, 
    			Map<String, String> headers, 
    			Map<String, String> querys)
                throws Exception {    	
        	HttpClient httpClient = wrapClient(host);
    
        	HttpGet request = new HttpGet(buildUrl(host, path, querys));
            for (Map.Entry<String, String> e : headers.entrySet()) {
            	request.addHeader(e.getKey(), e.getValue());
            }
            
            return httpClient.execute(request);
        }
    	
    	/**
    	 * post form
    	 * 
    	 * @param host
    	 * @param path
    	 * @param method
    	 * @param headers
    	 * @param querys
    	 * @param bodys
    	 * @return
    	 * @throws Exception
    	 */
    	public static HttpResponse doPost(String host, String path, String method, 
    			Map<String, String> headers, 
    			Map<String, String> querys, 
    			Map<String, String> bodys)
                throws Exception {    	
        	HttpClient httpClient = wrapClient(host);
    
        	HttpPost request = new HttpPost(buildUrl(host, path, querys));
            for (Map.Entry<String, String> e : headers.entrySet()) {
            	request.addHeader(e.getKey(), e.getValue());
            }
    
            if (bodys != null) {
                List<NameValuePair> nameValuePairList = new ArrayList<NameValuePair>();
    
                for (String key : bodys.keySet()) {
                    nameValuePairList.add(new BasicNameValuePair(key, bodys.get(key)));
                }
                UrlEncodedFormEntity formEntity = new UrlEncodedFormEntity(nameValuePairList, "utf-8");
                formEntity.setContentType("application/x-www-form-urlencoded; charset=UTF-8");
                request.setEntity(formEntity);
            }
    
            return httpClient.execute(request);
        }	
    	
    	/**
    	 * Post String
    	 * 
    	 * @param host
    	 * @param path
    	 * @param method
    	 * @param headers
    	 * @param querys
    	 * @param body
    	 * @return
    	 * @throws Exception
    	 */
    	public static HttpResponse doPost(String host, String path, String method, 
    			Map<String, String> headers, 
    			Map<String, String> querys, 
    			String body)
                throws Exception {    	
        	HttpClient httpClient = wrapClient(host);
    
        	HttpPost request = new HttpPost(buildUrl(host, path, querys));
            for (Map.Entry<String, String> e : headers.entrySet()) {
            	request.addHeader(e.getKey(), e.getValue());
            }
    
            if (StringUtils.isNotBlank(body)) {
            	request.setEntity(new StringEntity(body, "utf-8"));
            }
    
            return httpClient.execute(request);
        }
    	
    	/**
    	 * Post stream
    	 * 
    	 * @param host
    	 * @param path
    	 * @param method
    	 * @param headers
    	 * @param querys
    	 * @param body
    	 * @return
    	 * @throws Exception
    	 */
    	public static HttpResponse doPost(String host, String path, String method, 
    			Map<String, String> headers, 
    			Map<String, String> querys, 
    			byte[] body)
                throws Exception {    	
        	HttpClient httpClient = wrapClient(host);
    
        	HttpPost request = new HttpPost(buildUrl(host, path, querys));
            for (Map.Entry<String, String> e : headers.entrySet()) {
            	request.addHeader(e.getKey(), e.getValue());
            }
    
            if (body != null) {
            	request.setEntity(new ByteArrayEntity(body));
            }
    
            return httpClient.execute(request);
        }
    	
    	/**
    	 * Put String
    	 * @param host
    	 * @param path
    	 * @param method
    	 * @param headers
    	 * @param querys
    	 * @param body
    	 * @return
    	 * @throws Exception
    	 */
    	public static HttpResponse doPut(String host, String path, String method, 
    			Map<String, String> headers, 
    			Map<String, String> querys, 
    			String body)
                throws Exception {    	
        	HttpClient httpClient = wrapClient(host);
    
        	HttpPut request = new HttpPut(buildUrl(host, path, querys));
            for (Map.Entry<String, String> e : headers.entrySet()) {
            	request.addHeader(e.getKey(), e.getValue());
            }
    
            if (StringUtils.isNotBlank(body)) {
            	request.setEntity(new StringEntity(body, "utf-8"));
            }
    
            return httpClient.execute(request);
        }
    	
    	/**
    	 * Put stream
    	 * @param host
    	 * @param path
    	 * @param method
    	 * @param headers
    	 * @param querys
    	 * @param body
    	 * @return
    	 * @throws Exception
    	 */
    	public static HttpResponse doPut(String host, String path, String method, 
    			Map<String, String> headers, 
    			Map<String, String> querys, 
    			byte[] body)
                throws Exception {    	
        	HttpClient httpClient = wrapClient(host);
    
        	HttpPut request = new HttpPut(buildUrl(host, path, querys));
            for (Map.Entry<String, String> e : headers.entrySet()) {
            	request.addHeader(e.getKey(), e.getValue());
            }
    
            if (body != null) {
            	request.setEntity(new ByteArrayEntity(body));
            }
    
            return httpClient.execute(request);
        }
    	
    	/**
    	 * Delete
    	 *  
    	 * @param host
    	 * @param path
    	 * @param method
    	 * @param headers
    	 * @param querys
    	 * @return
    	 * @throws Exception
    	 */
    	public static HttpResponse doDelete(String host, String path, String method, 
    			Map<String, String> headers, 
    			Map<String, String> querys)
                throws Exception {    	
        	HttpClient httpClient = wrapClient(host);
    
        	HttpDelete request = new HttpDelete(buildUrl(host, path, querys));
            for (Map.Entry<String, String> e : headers.entrySet()) {
            	request.addHeader(e.getKey(), e.getValue());
            }
            
            return httpClient.execute(request);
        }
    	
    	private static String buildUrl(String host, String path, Map<String, String> querys) throws UnsupportedEncodingException {
        	StringBuilder sbUrl = new StringBuilder();
        	sbUrl.append(host);
        	if (!StringUtils.isBlank(path)) {
        		sbUrl.append(path);
            }
        	if (null != querys) {
        		StringBuilder sbQuery = new StringBuilder();
            	for (Map.Entry<String, String> query : querys.entrySet()) {
            		if (0 < sbQuery.length()) {
            			sbQuery.append("&");
            		}
            		if (StringUtils.isBlank(query.getKey()) && !StringUtils.isBlank(query.getValue())) {
            			sbQuery.append(query.getValue());
                    }
            		if (!StringUtils.isBlank(query.getKey())) {
            			sbQuery.append(query.getKey());
            			if (!StringUtils.isBlank(query.getValue())) {
            				sbQuery.append("=");
            				sbQuery.append(URLEncoder.encode(query.getValue(), "utf-8"));
            			}        			
                    }
            	}
            	if (0 < sbQuery.length()) {
            		sbUrl.append("?").append(sbQuery);
            	}
            }
        	
        	return sbUrl.toString();
        }
    	
    	private static HttpClient wrapClient(String host) {
    		HttpClient httpClient = new DefaultHttpClient();
    		if (host.startsWith("https://")) {
    			sslClient(httpClient);
    		}
    		
    		return httpClient;
    	}
    	
    	private static void sslClient(HttpClient httpClient) {
            try {
                SSLContext ctx = SSLContext.getInstance("TLS");
                X509TrustManager tm = new X509TrustManager() {
                    public X509Certificate[] getAcceptedIssuers() {
                        return null;
                    }
                    public void checkClientTrusted(X509Certificate[] xcs, String str) {
                    	
                    }
                    public void checkServerTrusted(X509Certificate[] xcs, String str) {
                    	
                    }
                };
                ctx.init(null, new TrustManager[] { tm }, null);
                SSLSocketFactory ssf = new SSLSocketFactory(ctx);
                ssf.setHostnameVerifier(SSLSocketFactory.ALLOW_ALL_HOSTNAME_VERIFIER);
                ClientConnectionManager ccm = httpClient.getConnectionManager();
                SchemeRegistry registry = ccm.getSchemeRegistry();
                registry.register(new Scheme("https", 443, ssf));
            } catch (KeyManagementException ex) {
                throw new RuntimeException(ex);
            } catch (NoSuchAlgorithmException ex) {
            	throw new RuntimeException(ex);
            }
        }
    }
    
    
    
    Img2Base64Util类
    
    ```java
    package ideal4j.leisure.platform.bwyd.faceBomparisonALi.service;
    
    import java.io.FileInputStream;
    import java.io.FileOutputStream;
    import java.io.IOException;
    import java.io.InputStream;
    import java.io.OutputStream;
    
    import org.apache.commons.codec.binary.Base64;
    
    
    import sun.misc.BASE64Encoder;
    
    public class Img2Base64Util {
    
    
    //将图片文件转化为字节数组字符串,并对其转化为--->Base64编码
    
    public static String GetImageStrs(String imgFilePath){
    	   byte[] data = null;
    	   try {
    		   InputStream in = new FileInputStream(imgFilePath);
    		   data = new byte[in.available()];
    		   in.read(data);
               in.close();
    	       } catch (Exception e) {
    	    	   e.printStackTrace();
    	     }
    	// 对字节数组Base64编码
    	   BASE64Encoder encoder = new BASE64Encoder();
           
    	 return   encoder.encode(data);// 返回Base64编码过的字节数组字符串
    }
    
    
    
    
    }
    

    百度人脸对比代码

    FaceBomparisonBaiduAction类

    package ideal4j.leisure.platform.bwyd.faceBomparisonBaidu.action;
    
    import ideal4j.leisure.platform.bwyd.faceBomparisonBaidu.service.FaceMatch;
    
    public class FaceBomparisonBaiduAction {
    
    	public static void main(String[] args) {
    		FaceMatch.match();
    	}
    }
    

    AuthService类

    package ideal4j.leisure.platform.bwyd.faceBomparisonBaidu.service;
    
    
    import org.json.JSONObject;
    
    import java.io.BufferedReader;
    import java.io.InputStreamReader;
    import java.net.HttpURLConnection;
    import java.net.URL;
    import java.util.List;
    import java.util.Map;
    
    /**
     * 获取token类
     */
    public class AuthService {
    
        /**
         * 获取权限token
         * @return 返回示例:
         * {
         * "access_token": "24.460da4889caad24cccdb1fea17221975.2592000.1491995545.282335-1234567",
         * "expires_in": 2592000
         * }
         */
        public static String getAuth() {
            // 官网获取的 API Key 更新为你注册的
            String clientId = "111111111111111111111111";
            // 官网获取的 Secret Key 更新为你注册的
            String clientSecret = "111111111111111111111111111111";
            System.out.println("token:==========="+getAuth(clientId, clientSecret));
            return getAuth(clientId, clientSecret);
        }
    
        /**
         * 获取API访问token
         * 该token有一定的有效期,需要自行管理,当失效时需重新获取.
         * @param ak - 百度云官网获取的 API Key
         * @param sk - 百度云官网获取的 Securet Key
         * @return assess_token 示例:
         * "24.460da4889caad24cccdb1fea17221975.2592000.1491995545.282335-1234567"
         */
        public static String getAuth(String ak, String sk) {
            // 获取token地址
            String authHost = "https://aip.baidubce.com/oauth/2.0/token?";
            String getAccessTokenUrl = authHost
                    // 1. grant_type为固定参数
                    + "grant_type=client_credentials"
                    // 2. 官网获取的 API Key
                    + "&client_id=" + ak
                    // 3. 官网获取的 Secret Key
                    + "&client_secret=" + sk;
            try {
                URL realUrl = new URL(getAccessTokenUrl);
                // 打开和URL之间的连接
                HttpURLConnection connection = (HttpURLConnection) realUrl.openConnection();
                connection.setRequestMethod("GET");
                connection.connect();
                // 获取所有响应头字段
                Map<String, List<String>> map = connection.getHeaderFields();
                // 遍历所有的响应头字段
                for (String key : map.keySet()) {
                    System.err.println(key + "--->" + map.get(key));
                }
                // 定义 BufferedReader输入流来读取URL的响应
                BufferedReader in = new BufferedReader(new InputStreamReader(connection.getInputStream()));
                String result = "";
                String line;
                while ((line = in.readLine()) != null) {
                    result += line;
                }
                /**
                 * 返回结果示例
                 */
                System.err.println("result:" + result);
                JSONObject jsonObject = new JSONObject(result);
                String access_token = jsonObject.getString("access_token");
                return access_token;
            } catch (Exception e) {
                System.err.printf("获取token失败!");
                e.printStackTrace(System.err);
            }
            return null;
        }
    
    }
    

    Base64Util类

    package ideal4j.leisure.platform.bwyd.faceBomparisonBaidu.service;
    
    
    /**
     * Base64 
     */
    public class Base64Util {
        private static final char last2byte = (char) Integer.parseInt("00000011", 2);
        private static final char last4byte = (char) Integer.parseInt("00001111", 2);
        private static final char last6byte = (char) Integer.parseInt("00111111", 2);
        private static final char lead6byte = (char) Integer.parseInt("11111100", 2);
        private static final char lead4byte = (char) Integer.parseInt("11110000", 2);
        private static final char lead2byte = (char) Integer.parseInt("11000000", 2);
        private static final char[] encodeTable = new char[]{'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '+', '/'};
     
        public Base64Util() {
        }
     
        public static String encode(byte[] from) {
            StringBuilder to = new StringBuilder((int) ((double) from.length * 1.34D) + 3);
            int num = 0;
            char currentByte = 0;
     
            int i;
            for (i = 0; i < from.length; ++i) {
                for (num %= 8; num < 8; num += 6) {
                    switch (num) {
                        case 0:
                            currentByte = (char) (from[i] & lead6byte);
                            currentByte = (char) (currentByte >>> 2);
                        case 1:
                        case 3:
                        case 5:
                        default:
                            break;
                        case 2:
                            currentByte = (char) (from[i] & last6byte);
                            break;
                        case 4:
                            currentByte = (char) (from[i] & last4byte);
                            currentByte = (char) (currentByte << 2);
                            if (i + 1 < from.length) {
                                currentByte = (char) (currentByte | (from[i + 1] & lead2byte) >>> 6);
                            }
                            break;
                        case 6:
                            currentByte = (char) (from[i] & last2byte);
                            currentByte = (char) (currentByte << 4);
                            if (i + 1 < from.length) {
                                currentByte = (char) (currentByte | (from[i + 1] & lead4byte) >>> 4);
                            }
                    }
     
                    to.append(encodeTable[currentByte]);
                }
            }
     
            if (to.length() % 4 != 0) {
                for (i = 4 - to.length() % 4; i > 0; --i) {
                    to.append("=");
                }
            }
     
            return to.toString();
        }
    }
    
    FaceMatch类
    package ideal4j.leisure.platform.bwyd.faceBomparisonBaidu.service;
    
    
    
    
    
    import java.util.*;
    
    /**
    * 人脸对比
    */
    public class FaceMatch {
    
        /**
        * 重要提示代码中所需工具类
        * FileUtil,Base64Util,HttpUtil,GsonUtils请从
        * https://ai.baidu.com/file/658A35ABAB2D404FBF903F64D47C1F72
        * https://ai.baidu.com/file/C8D81F3301E24D2892968F09AE1AD6E2
        * https://ai.baidu.com/file/544D677F5D4E4F17B4122FBD60DB82B3
        * https://ai.baidu.com/file/470B3ACCA3FE43788B5A963BF0B625F3
        * 下载
        */
        public static String match() {
            // 请求url
            String url = "https://aip.baidubce.com/rest/2.0/face/v3/match";
            try {
    
                byte[] bytes1 = FileUtil.readFileByBytes("E:/人脸对比/女c.png");
                byte[] bytes2 = FileUtil.readFileByBytes("E:/人脸对比/女b.png");
                String image1 = Base64Util.encode(bytes1);
                String image2 = Base64Util.encode(bytes2);
    
                List<Map<String, Object>> images = new ArrayList<>();
    
                Map<String, Object> map1 = new HashMap<>();
                map1.put("image", image1);
                map1.put("image_type", "BASE64");
                map1.put("face_type", "LIVE");
                map1.put("quality_control", "LOW");
                map1.put("liveness_control", "NORMAL");
    
                Map<String, Object> map2 = new HashMap<>();
                map2.put("image", image2);
                map2.put("image_type", "BASE64");
                map2.put("face_type", "LIVE");
                map2.put("quality_control", "LOW");
                map2.put("liveness_control", "NORMAL");
    
                images.add(map1);
                images.add(map2);
    
                String param = GsonUtils.toJson(images);
    
                // 注意这里仅为了简化编码每一次请求都去获取access_token,线上环境access_token有过期时间, 客户端可自行缓存,过期后重新获取。
                String accessToken = AuthService.getAuth();
    
                String result = HttpUtil.post(url, accessToken, "application/json", param);
                System.out.println(result);
                return result;
            } catch (Exception e) {
                e.printStackTrace();
            }
            return null;
        }
    
        public static void main(String[] args) {
            FaceMatch.match();
        }
    }
    
    FileUtil类
    package ideal4j.leisure.platform.bwyd.faceBomparisonBaidu.service;
    
    import java.io.*;
    
    /**
     * 鏂囦欢璇诲彇宸ュ叿绫�
     */
    public class FileUtil {
     
        /**
         * 璇诲彇鏂囦欢鍐呭锛屼綔涓哄瓧绗︿覆杩斿洖
         */
        public static String readFileAsString(String filePath) throws IOException {
            File file = new File(filePath);
            if (!file.exists()) {
                throw new FileNotFoundException(filePath);
            } 
     
            if (file.length() > 1024 * 1024 * 1024) {
                throw new IOException("File is too large");
            } 
     
            StringBuilder sb = new StringBuilder((int) (file.length()));
            // 鍒涘缓瀛楄妭杈撳叆娴�  
            FileInputStream fis = new FileInputStream(filePath);  
            // 鍒涘缓涓�涓暱搴︿负10240鐨凚uffer
            byte[] bbuf = new byte[10240];  
            // 鐢ㄤ簬淇濆瓨瀹為檯璇诲彇鐨勫瓧鑺傛暟  
            int hasRead = 0;  
            while ( (hasRead = fis.read(bbuf)) > 0 ) {  
                sb.append(new String(bbuf, 0, hasRead));  
            }  
            fis.close();  
            return sb.toString();
        }
     
        /**
         * 鏍规嵁鏂囦欢璺緞璇诲彇byte[] 鏁扮粍
         */
        public static byte[] readFileByBytes(String filePath) throws IOException {
            File file = new File(filePath);
            if (!file.exists()) {
                throw new FileNotFoundException(filePath);
            } else {
                ByteArrayOutputStream bos = new ByteArrayOutputStream((int) file.length());
                BufferedInputStream in = null;
     
                try {
                    in = new BufferedInputStream(new FileInputStream(file));
                    short bufSize = 1024;
                    byte[] buffer = new byte[bufSize];
                    int len1;
                    while (-1 != (len1 = in.read(buffer, 0, bufSize))) {
                        bos.write(buffer, 0, len1);
                    }
     
                    byte[] var7 = bos.toByteArray();
                    return var7;
                } finally {
                    try {
                        if (in != null) {
                            in.close();
                        }
                    } catch (IOException var14) {
                        var14.printStackTrace();
                    }
     
                    bos.close();
                }
            }
        }
    }
    
    GsonUtils类
    package ideal4j.leisure.platform.bwyd.faceBomparisonBaidu.service;
    
    
    import com.google.gson.Gson;
    import com.google.gson.GsonBuilder;
    import com.google.gson.JsonParseException;
     
    import java.lang.reflect.Type;
     
    /**
     * Json宸ュ叿绫�.
     */
    public class GsonUtils {
        private static Gson gson = new GsonBuilder().create();
     
        public static String toJson(Object value) {
            return gson.toJson(value);
        }
     
        public static <T> T fromJson(String json, Class<T> classOfT) throws JsonParseException {
            return gson.fromJson(json, classOfT);
        }
     
        public static <T> T fromJson(String json, Type typeOfT) throws JsonParseException {
            return (T) gson.fromJson(json, typeOfT);
        }
    }
    
    HttpUtil类
    package ideal4j.leisure.platform.bwyd.faceBomparisonBaidu.service;
    
    import java.io.BufferedReader;
    import java.io.DataOutputStream;
    import java.io.InputStreamReader;
    import java.net.HttpURLConnection;
    import java.net.URL;
    import java.util.List;
    import java.util.Map;
     
    /**
     * http 宸ュ叿绫�
     */
    public class HttpUtil {
     
        public static String post(String requestUrl, String accessToken, String params)
                throws Exception {
            String contentType = "application/x-www-form-urlencoded";
            return HttpUtil.post(requestUrl, accessToken, contentType, params);
        }
     
        public static String post(String requestUrl, String accessToken, String contentType, String params)
                throws Exception {
            String encoding = "UTF-8";
            if (requestUrl.contains("nlp")) {
                encoding = "GBK";
            }
            return HttpUtil.post(requestUrl, accessToken, contentType, params, encoding);
        }
     
        public static String post(String requestUrl, String accessToken, String contentType, String params, String encoding)
                throws Exception {
            String url = requestUrl + "?access_token=" + accessToken;
            return HttpUtil.postGeneralUrl(url, contentType, params, encoding);
        }
     
        public static String postGeneralUrl(String generalUrl, String contentType, String params, String encoding)
                throws Exception {
            URL url = new URL(generalUrl);
            // 鎵撳紑鍜孶RL涔嬮棿鐨勮繛鎺�
            HttpURLConnection connection = (HttpURLConnection) url.openConnection();
            connection.setRequestMethod("POST");
            // 璁剧疆閫氱敤鐨勮姹傚睘鎬�
            connection.setRequestProperty("Content-Type", contentType);
            connection.setRequestProperty("Connection", "Keep-Alive");
            connection.setUseCaches(false);
            connection.setDoOutput(true);
            connection.setDoInput(true);
     
            // 寰楀埌璇锋眰鐨勮緭鍑烘祦瀵硅薄
            DataOutputStream out = new DataOutputStream(connection.getOutputStream());
            out.write(params.getBytes(encoding));
            out.flush();
            out.close();
     
            // 寤虹珛瀹為檯鐨勮繛鎺�
            connection.connect();
            // 鑾峰彇鎵�鏈夊搷搴斿ご瀛楁
            Map<String, List<String>> headers = connection.getHeaderFields();
            // 閬嶅巻鎵�鏈夌殑鍝嶅簲澶村瓧娈�
            for (String key : headers.keySet()) {
                System.err.println(key + "--->" + headers.get(key));
            }
            // 瀹氫箟 BufferedReader杈撳叆娴佹潵璇诲彇URL鐨勫搷搴�
            BufferedReader in = null;
            in = new BufferedReader(
                    new InputStreamReader(connection.getInputStream(), encoding));
            String result = "";
            String getLine;
            while ((getLine = in.readLine()) != null) {
                result += getLine;
            }
            in.close();
            System.err.println("result:" + result);
            return result;
        }
    }
    

    百度人脸识别地址:https://ai.baidu.com/docs#/Face-Match-V3/top
    阿里人脸识别:https://market.aliyun.com/products/57124001/cmapi031353.html?spm=5176.10695662.1996646101.searchclickresult.253668d3LDsRUF&aly_as=khYD9ZI_

    复制代码后需要修改appcode, API Key,Secret Key,和图片地址

    展开全文
  • 人脸识别,调用百度实现的demo。百度人脸识别,人脸查找,人脸对比。百度人脸识别,人脸查找,人脸对比
  • c#人脸识别,人脸特征提取实例运行程序,进行人脸关键部位截取,并进行人脸对比
  • 百度AI图像处理(V3版本)—人脸识别(人脸对比)调用教程(基于Python3-附Demo)
  • 一款基于讯飞人脸对比API的Python源码。可以方便选择两张人脸照片进行相似度判断。注意:需要自行注册讯飞人脸对比接口。
  • 简单的获取token,人脸侦测、2张人脸对比相似度。 适合新人学习
  • 人脸对比实战项目

    2019-01-10 21:39:59
    人脸对比实战项目,IDEA搭建,可用IDEA直接打开,可参考我的博客: https://blog.csdn.net/haoranhaoshi/article/details/85954440
  • 通过百度人脸对比API进行人脸对比

    千次阅读 2018-05-27 21:54:36
    百度人脸对比API的使用 今天突然有兴趣想做个人脸识别的小demo,项目代码地址:https://github.com/lxixi01/Face_Recognition 效果如下: 步骤: 第一步,需要建立一个百度账号,申请自己的AppID, API Key和...

    百度人脸对比API的使用

    今天突然有兴趣想做个人脸识别的小demo,项目代码地址:https://github.com/lxixi01/Face_Recognition

    效果如下:

     

    步骤:

    第一步,需要建立一个百度账号,申请自己的AppID, API Key和Secret Key 

                地址为:http://ai.baidu.com/tech/face/compare

    第二步:官网下载SDK,导入jar包到项目中,官网提供了下载地址 

       下面是对比两张图片的人脸的借口调用方法

    返回结果为json字符串:

    {"error_code":0,"error_msg":"SUCCESS","log_id":3017296944,"timestamp":1527427917,"cached":0,

    "result":{"score":93.78884125,"face_list":[{"face_token":"a29943d3b09c7ea637070f5ec40228ea"},{"face_token":"6c588b50c9c14f12721e6f4d5383b102"}]}}

    其中"score"为:两张人脸的相识度(0~100),建议为80以上,"face_token"为两张人脸图片的唯一标识,我们只需要解释json字符串获取score就行了

        调用接口的方法
        * 重要提示代码中所需工具类
        * FileUtil,Base64Util,HttpUtil,GsonUtils请从
        * https://ai.baidu.com/file/658A35ABAB2D404FBF903F64D47C1F72
        * https://ai.baidu.com/file/C8D81F3301E24D2892968F09AE1AD6E2
        * https://ai.baidu.com/file/544D677F5D4E4F17B4122FBD60DB82B3
        * https://ai.baidu.com/file/470B3ACCA3FE43788B5A963BF0B625F3
        * 下载
        */
        public static String match() {
            // 请求url
            String url = "https://aip.baidubce.com/rest/2.0/face/v3/match";
            try {
    
    
                byte[] bytes1 = FileUtil.readFileByBytes("【本地文件1地址】");
                byte[] bytes2 = FileUtil.readFileByBytes("【本地文件2地址】");
                String image1 = Base64Util.encode(bytes1);
                String image2 = Base64Util.encode(bytes2);
    
    
                List<Map<String, Object>> images = new ArrayList<>();
    
    
                Map<String, Object> map1 = new HashMap<>();
                map1.put("image", image1);
                map1.put("image_type", "BASE64");
                map1.put("face_type", "LIVE");
                map1.put("quality_control", "LOW");
                map1.put("liveness_control", "NORMAL");
    
    
                Map<String, Object> map2 = new HashMap<>();
                map2.put("image", image2);
                map2.put("image_type", "BASE64");
                map2.put("face_type", "LIVE");
                map2.put("quality_control", "LOW");
                map2.put("liveness_control", "NORMAL");
    
    
                images.add(map1);
                images.add(map2);
    
    
                String param = GsonUtils.toJson(images);
    
    
                // 注意这里仅为了简化编码每一次请求都去获取access_token,线上环境access_token有过期时间, 客户端可自行缓存,过期后重新获取。
                String accessToken = "【调用鉴权接口获取的token】";
    
    
                String result = HttpUtil.post(url, accessToken, "application/json", param);
                System.out.println(result);
                return result;
            } catch (Exception e) {
                e.printStackTrace();
            }
            return null;
        }

    下面是获取token的方法:

    /**
    	 * 获取权限token
    	 * 
    	 */
    	public static String getAuth() {
    		// 官网获取的 API Key 更新为你注册的
    		String clientId = "WrI9oUhvrG0GHngIFioNKxki";
    		// 官网获取的 Secret Key 更新为你注册的
    		String clientSecret = "WfGDqAyom7t8wunqYUM4sAw0SBhjlBZj";
    		return getAuth(clientId, clientSecret);
    	}
    
    	/**
    	 * 获取API访问token 该token有一定的有效期,需要自行管理,当失效时需重新获取.
    	 * 
    	 * @param ak
    	 *            - 百度云官网获取的 API Key
    	 * @param sk
    	 *            - 百度云官网获取的 Securet Key
    	 * @return assess_token 示例:
    	 *         "24.460da4889caad24cccdb1fea17221975.2592000.1491995545.282335-1234567"
    	 */
    	public static String getAuth(String ak, String sk) {
    		// 获取token地址
    		String authHost = "https://aip.baidubce.com/oauth/2.0/token?";
    		String getAccessTokenUrl = authHost
    		// 1. grant_type为固定参数
    				+ "grant_type=client_credentials"
    				// 2. 官网获取的 API Key
    				+ "&client_id=" + ak
    				// 3. 官网获取的 Secret Key
    				+ "&client_secret=" + sk;
    		try {
    			URL realUrl = new URL(getAccessTokenUrl);
    			// 打开和URL之间的连接
    			HttpURLConnection connection = (HttpURLConnection) realUrl
    					.openConnection();
    			connection.setRequestMethod("GET");
    			connection.connect();
    			// 获取所有响应头字段
    			Map<String, List<String>> map = connection.getHeaderFields();
    			// 遍历所有的响应头字段
    			for (String key : map.keySet()) {
    				System.err.println(key + "--->" + map.get(key));
    			}
    			// 定义 BufferedReader输入流来读取URL的响应
    			BufferedReader in = new BufferedReader(new InputStreamReader(
    					connection.getInputStream()));
    			String result = "";
    			String line;
    			while ((line = in.readLine()) != null) {
    				result += line;
    			}
    			/**
    			 * 返回结果示例
    			 */
    			JSONObject jsonObject = new JSONObject(result);
    			String access_token = jsonObject.getString("access_token");
    			return access_token;
    		} catch (Exception e) {
    			System.err.printf("获取token失败!");
    			e.printStackTrace(System.err);
    		}
    		return null;
    	}

    获得了两张人脸图片的相识度之后,亲们就可以根据自己的情况做逻辑处理了。

    由于方法返回的是一串json字符串,下面是我的对json的解析获取score

    String res = faceMatch(base64,user.toString());//这是我自己修改过的人脸对比方法,只是加了参数,返回结果的格式不变
    			JsonObject jObject = new JsonParser().parse(res).getAsJsonObject();
    			JsonElement jsonElement = jObject.get("result");
    			float score = 0;
    			if(!jsonElement.isJsonNull()){    //人脸对比出错的话,这里是空的
    				score = jsonElement.getAsJsonObject().get("score").getAsFloat();
    			}

    以上是对自己的业余兴趣做个记录。
     

     

     

    转载请注明出处

     

    展开全文
  • 安卓opencv实现人脸检测,人脸识别,人脸对比,实现opencv对图像的翻转,镜像等操作。实现多人检测
  • 百度人脸对比Demo

    2019-04-01 11:48:50
    1、该Demo主要使用C#实现调用百度人脸对比接口功能; 2、项目使用VS2017创建; 3、在代码中填入自己的AppID、API Key、Secret Key值即可以,如何获取Key请参阅解压后的文档《获取Key步骤.txt》。
  • 第四步 Token和工具类准备完毕,写人脸对比代码 2张对比图片 FaceMatch类 import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; public class FaceMatch{ /** * ...
  • 包括百度人脸对比接口,阿里人脸对比接口和腾讯人脸对比接口,已通过测试,可直接申请appkey调用
  • 调用了百度的人脸对比接口,使用winform完成,代码注释较多,适用于新手,大牛就不要下载了
  • 人脸对比与人脸检测人脸对比查看API文档获取Access Token图片转为base64格式请求参数调用返回示例人脸检测代码返回示例错误识别错误码 人脸对比 两张人脸1 :1对比,得到人脸相识度。 查看API文档 人脸识别接口分为...

    人脸对比

    两张人脸1 :1对比,得到人脸相识度。

    查看API文档

    人脸识别接口分为V2和V3两个版本,本文档为V3版本接口的说明文档,请确认您在百度云后台获得的是V3版本接口权限,再来阅读本文档。

    辨别接口版本的方法是:在百度云后台进入【应用列表】,点击【应用名称】,在【API列表】中可以看到【请求地址】,若请求地址中带有【v3】标识,则您具有的是v3权限,可以阅读本文档;若请求地址中带有【v2】标识,则您具有的是v2权限,应该去阅读v2文档。

    Base64编码:请求的图片需经过Base64编码,图片的base64编码指将图片数据编码成一串字符串,使用该字符串代替图像地址。您可以首先得到图片的二进制,然后用Base64格式编码即可。
    图片格式:现支持PNG、JPG、JPEG、BMP,不支持GIF图片。

    获取Access Token

    向API服务地址使用POST发送请求,必须在URL中带上参数access_token,可通过后台的API Key和Secret Key生成。

    API_Key = '自己的API_Key'
    Secret_Key = '自己的Secret_Key '
    def get_token_baidu():
    	client_id = API_Key
    	client_secret = Secret_Key
    	host = 'https://aip.baidubce.com/oauth/2.0/token?grant_type=client_credentials&client_id=%s&client_secret=%s'%(API_Key,Secret_Key)
    	response = requests.get(host)
    	if response:
    		print(response.json())
    		return response.json()['access_token']
    

    图片转为base64格式

    def get_imgdata(file1path, file2path):
    	f = open(r'%s'%file1path,'rb')
    	pic1 = base64.b64encode(f.read())
    	f.close()
    
    	f = open(r'%s'%file2path,'rb')
    	pic2 = base64.b64encode(f.read())
    	f.close()
    
    	strp1 = str(pic1,'UTF-8')
    	strp2 = str(pic2,'UTF-8')
    	return strp1,strp2
    

    请求参数

    两张图片上传时的JSON格式
    [
        {
            "image": "sfasq35sadvsvqwr5q...",通过BASE64转码后得到的图片文件
            "image_type": "BASE64",
            "face_type": "LIVE",
            "quality_control": "LOW",
            "liveness_control": "HIGH"
        },
        {
            "image": "sfasq35sadvsvqwr5q...",
            "image_type": "BASE64",
            "face_type": "IDCARD",
            "quality_control": "LOW",
            "liveness_control": "HIGH"
        }
    ]
    

    人脸对比函数,传入两张合法的格式图片(PNG、JPG、JPEG、BMP),通过get_ingdata()函数得到base64转码后的图片。

    def myface_compare(file1path, file2path):
    	strp1,strp2 = get_imgdata(file1path, file2path)
    	
    	#HTTP方法:POST
    	#URL: https://aip.baidubce.com/rest/2.0/face/v3/match
    	request_url = "https://aip.baidubce.com/rest/2.0/face/v3/match"
    	
    	#Body中放置请求参数
    	params = "[{\"image\": \"%s\", \"image_type\": \"BASE64\", \"face_type\": \"LIVE\", \"quality_control\": \"LOW\"},{\"image\": \"%s\", \"image_type\": \"BASE64\", \"face_type\": \"IDCARD\", \"quality_control\": \"LOW\"}]"%(strp1,strp2)
    	access_token = get_token_baidu()
    	request_url = request_url + "?access_token=" + access_token
    	headers = {'content-type': 'application/json'}
    	response = requests.post(request_url, data=params, headers=headers)
    	if response:
    		#print(response.json())
    		myret = response.json()
    		#print(type(myret))
    		print(myret)
    		score = myret['result']['score']
    		print(score)
    		return score
    

    调用

    #传进去两张图片的路径
    myface_compare("3.jpg","4.jpg")
    

    返回示例

    {
        "score": 44.3,
        "face_list": [  //返回的顺序与传入的顺序保持一致
            {
                "face_token": "fid1"
            },
            {
                "face_token": "fid2"
            }
        ]
    }
    

    在这里插入图片描述

    人脸检测

    接口能力
    人脸检测:检测图片中的人脸并标记出位置信息;
    人脸关键点:展示人脸的核心关键点信息,及150个关键点信息。
    人脸属性值:展示人脸属性信息,如年龄、性别等。
    人脸质量信息:返回人脸各部分的遮挡、光照、模糊、完整度、置信度等信息。

    获取Access Token和图片转码与人脸对比方法一致,不同的是这里请求参数;

    HTTP方法:POST
    请求URL: https://aip.baidubce.com/rest/2.0/face/v3/detect
    

    在这里插入图片描述
    需要检测人脸的什么信息,添加相应的参数就可以了:
    max_face_num=10,最大处理人脸的个数
    face_fields=age,beauty,expression,faceshape,gender,glasses,race,quality,emotion,mask,landmark150(年龄、样貌得分、表情、脸型…)

    代码

    使用之前注意更换自己的API_key,Secret_Key

    import os
    import sys
    import ssl
    import base64
    import requests
    from urllib import request
    
    def get_token_baidu():
        client_id='自己的API_Key'
        client_secret='自己的secret_key'
        host = 'https://aip.baidubce.com/oauth/2.0/token?grant_type=client_credentials&client_id=%s&client_secret=%s'%(client_id,client_secret)
        response = requests.get(host)
        if response:
            print(response.json())
            return response.json()['access_token']
    
    def get_imgdata(file1path):
        f = open(r'%s'%file1path,'rb')
        print(f)
        pic1 = base64.b64encode(f.read())
        f.close()
        strp1 = str(pic1,'UTF-8')
        return strp1
    
    def myface_compare(file1path):
        strp1= get_imgdata(file1path)
        request_url = "https://aip.baidubce.com/rest/2.0/face/v3/detect"
    
        params = "{\"image\":\"%s\",\"image_type\":\"BASE64\",\"max_face_num\":10,\"face_field\":\"age,beauty,expression,face_shape,gender,glasses,landmark,landmark150,race,\
    quality,eye_status,emotion,face_type,mask,spoofing\"}"%(strp1)
        access_token = get_token_baidu()
        request_url = request_url + "?access_token=" + access_token
        headers = {'content-type': 'application/json'}
        response = requests.post(request_url, data=params, headers=headers)
        j=1
        if response:
            #print (response.json())
            print (response.json()['result'])
            print(response.json()['result']['face_num'])
            for i in response.json()['result']['face_list']:
                print("第%d张脸:"%j,i['face_token'])
                print("age:",i['age'])
                print("beauty:",i['beauty'])
                print("expression:",i['expression']['type'])
                print("gender:",i['gender']['type'])
                print("glasses:",i['glasses']['type'])
                j+=1
    myface_compare("5.jpg")
    

    返回示例

    在这里插入图片描述

    这里从返回结果中提取了face_token、年龄、beauty(样貌得分)、表情、性别、有无眼镜。

    这个API可以获取颜值得分哦,想要知道自己颜值能得多少分,人脸检测帮你检测,亲测可以使用。

    错误识别错误码

    请参考人脸识别错误码

    展开全文
  • Java基于百度AI平台开发的人脸对比小程序,适用于任何Java项目的开发。
  • 4、人脸识别-人脸对比

    千次阅读 2018-05-25 15:54:07
    人脸对比 接口能力 两张人脸图片相似度对比:比对两张图片中人脸的相似度,并返回相似度分值; 多种图片类型:支持生活照、证件照、身份证芯片照、带网纹照四种类型的人脸对比; 活体检测控制:基于图片中的...

    人脸对比


    接口能力

    • 两张人脸图片相似度对比:比对两张图片中人脸的相似度,并返回相似度分值;
    • 多种图片类型:支持生活照、证件照、身份证芯片照、带网纹照四种类型的人脸对比;
    • 活体检测控制:基于图片中的破绽分析,判断其中的人脸是否为二次翻拍(举例:如用户A用手机拍摄了一张包含人脸的图片一,用户B翻拍了图片一得到了图片二,并用图片二伪造成用户A去进行识别操作,这种情况普遍发生在金融开户、实名认证等环节。);
    • 质量检测控制:分析图片的中人脸的模糊度、角度、光照强度等特征,判断图片质量;

    Java代码

    package com.niu.core;
    
    import java.util.ArrayList;
    import java.util.HashMap;
    import java.util.List;
    import java.util.Map;
    
    import com.baidu.aip.util.Base64Util;
    import com.niu.utils.FileUtil;
    import com.niu.utils.GsonUtils;
    import com.niu.utils.HttpUtil;
    
    public class FaceMatch {
          /**
            * 重要提示代码中所需工具类
            * FileUtil,Base64Util,HttpUtil,GsonUtils请从
            * https://ai.baidu.com/file/658A35ABAB2D404FBF903F64D47C1F72
            * https://ai.baidu.com/file/C8D81F3301E24D2892968F09AE1AD6E2
            * https://ai.baidu.com/file/544D677F5D4E4F17B4122FBD60DB82B3
            * https://ai.baidu.com/file/470B3ACCA3FE43788B5A963BF0B625F3
            * 下载
            */
            public static String match() {
                // 请求url
                String url = "https://aip.baidubce.com/rest/2.0/face/v3/match";
                try {
    
                    byte[] bytes1 = FileUtil.readFileByBytes("D:/test.jpg");
                    byte[] bytes2 = FileUtil.readFileByBytes("D:/20180524150429.jpg");
                    String image1 = Base64Util.encode(bytes1);
                    String image2 = Base64Util.encode(bytes2);
    
                    List<Map<String, Object>> images = new ArrayList<>();
    
                    Map<String, Object> map1 = new HashMap<>();
                    map1.put("image", image1);
                    map1.put("image_type", "BASE64");
                    map1.put("face_type", "LIVE");
                    map1.put("quality_control", "LOW");
                    map1.put("liveness_control", "NORMAL");
    
                    Map<String, Object> map2 = new HashMap<>();
                    map2.put("image", image2);
                    map2.put("image_type", "BASE64");
                    map2.put("face_type", "LIVE");
                    map2.put("quality_control", "LOW");
                    map2.put("liveness_control", "NORMAL");
    
                    images.add(map1);
                    images.add(map2);
    
                    String param = GsonUtils.toJson(images);
    
                    // 注意这里仅为了简化编码每一次请求都去获取access_token,线上环境access_token有过期时间, 客户端可自行缓存,过期后重新获取。
                    String accessToken = "24.c471d948d48110e589f576335a241342.2592000.1529745160.282335-11292282";
    
                    String result = HttpUtil.post(url, accessToken, "application/json", param);
                    System.out.println(result);
                    return result;
                } catch (Exception e) {
                    e.printStackTrace();
                }
                return null;
            }
    
    }
    

    返回示例

    {
        "score": 44.3,
        "face_list": [  //返回的顺序与传入的顺序保持一致
            {
                "face_token": "fid1"
            },
            {
                "face_token": "fid2"
            }
        ]
    }

    赞赏

    这里写图片描述

    源码

    展开全文
  • 人脸对比 https://ai.baidu.com/ai-doc/FACE/Lk37c1tpf
  • 百度AI人脸识别和人脸对比详细

    千次阅读 2020-07-09 17:20:16
    一、 人脸对比 (一)APIContants 1.APIContants.java 2.主要参数维护 APPID // 工程ID API_KEY //百度人脸识别应用apikey SERCET_KEY //百度人脸识别应用sercetkey TOKEN //百度人脸识别token 有效期一个月 3.代码...
  • Android人脸对比

    千次阅读 2015-11-29 13:37:49
    由于个人的兴趣,自己写了一个人脸识别、对比的demo,这个demo中用到的人脸识别不是Android SDK中自带的FaceDetector而是使用的Face++提供的人脸识别和人脸探测的API,这个demo不仅实现了人脸探测和人脸对比,而且...
  • 人脸对比,等于两张人脸对比,识别 封装的所有识别函数,直接看下面调用就好了。 # coding:utf-8 ''' 本本次封装,我主要是做两张人脸对比。 就只人脸识别部分,简单应用。 # 调用注意事项,因为模型...
  • #百度人脸认证 ...-- 百度人脸对比 --> <dependency> <groupId>com.baidu.aip</groupId> <artifactId>java-sdk</artifactId> <version>4.12.0</version>..
  • 主要介绍了java腾讯AI人脸对比对接,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友们下面随着小编来一起学习学习吧
  • 百度API人脸对比 1.首先注册一个百度账号 2.百度AI平台https://ai.baidu.com/,找到 开放能力>人脸与人体检测>人脸对比>立即使用>创建应用 ,点击 创建 获取API Key和Secret Key 百度人脸识别接口链接...
  • 基于opencv开源库 摄像头人脸匹配 并与人脸对比识别
  • ios安卓人脸对比识别技术ios安卓人脸对比识别技术,人脸活体检测识别 产品背景 随着深度学习方法的应用,ios安卓人脸对比识别技术技术的识别率已经得到质的提升,目前我司的ios安卓人脸对比识别技术率已经达到99...
  • 1、首先在百度云平台,注册账号,并且进行... ... 2、进入人脸识别主页,创建应用 3、创建SDK授权应用 SDK与完整demo链接: demoCSDN链接:https://download.csdn.net/download/meixi_android/11153834 d...

空空如也

空空如也

1 2 3 4 5 ... 20
收藏数 24,000
精华内容 9,600
关键字:

人脸对比