package com.huimv.admin.analyse;

import com.alibaba.fastjson.JSON;
import com.baidu.aip.face.AipFace;
import com.baidu.aip.face.MatchRequest;
import org.json.JSONObject;

import java.util.ArrayList;
import java.util.Map;

/**
 * @Project : huimv.shiwan
 * @Package : com.huimv.admin.analyse
 * @Description : TODO
 * @Author : yuxuexuan
 * @Create : 2020/12/27 0027 14:11
 **/
public class Comparison {


   public void Comparison(AipFace client){
       String image1 = "C:/Users/Administrator/Desktop/1609048902097.jpg";
       String image2 = "C:/Users/Administrator/Desktop/1609048912029.jpg";

       // image1/image2也可以为url或facetoken, 相应的imageType参数需要与之对应。
       MatchRequest req1 = new MatchRequest(image1, "BASE64");
       MatchRequest req2 = new MatchRequest(image2, "BASE64");
       ArrayList<MatchRequest> requests = new ArrayList<MatchRequest>();
       requests.add(req1);
       requests.add(req2);

       JSONObject res = client.match(requests);
       System.out.println(res.toString(2));

   }
}
