| | |
| | | if((boolean) res.getData()) { |
| | | //重置标识 |
| | | res.setData(null); |
| | | res.setMsg(null); |
| | | //获取数据库中所有的人脸图片 |
| | | List<UserInf> userInfList = service.findAllFaceUrl(); |
| | | if(userInfList.size()==0){ |
| | | res.setCode(0); |
| | | res.setMsg("人脸库暂无任何数据"); |
| | | }else{ |
| | | boolean urlExist = false; |
| | | for (UserInf temp:userInfList){ |
| | | String filePath = temp.getFace().getUrl(); |
| | | File file = new File(filePath); |
| | | //不存在则不继续执行 |
| | | if(!file.exists()){ |
| | | continue; |
| | | }else{ |
| | | urlExist = true; |
| | | } |
| | | ImageInfo imageInfo2 = ImageFactory.getRGBData(file); |
| | | res = FaceIdentifyUtil.faceCompare(faceEngine, imageInfo, imageInfo2); |
| | |
| | | userService.setApplication(temp); |
| | | } |
| | | } |
| | | if(!urlExist){ |
| | | res.set(1,false,"ukey对应的人脸库路径不存在"); |
| | | } |
| | | } |
| | | } |
| | | } |