| | |
| | | import com.arcsoft.face.FaceEngine; |
| | | import com.arcsoft.face.toolkit.ImageFactory; |
| | | import com.arcsoft.face.toolkit.ImageInfo; |
| | | import com.whyc.constant.YamlProperties; |
| | | import com.whyc.dto.Response; |
| | | import com.whyc.factory.FaceEngineFactory; |
| | | import com.whyc.pojo.PermitGroup; |
| | |
| | | @ApiOperation(value = "在线激活人脸识别引擎",notes = "只需要刚开始时调用一次,会导致appId与硬件设备绑定,必须有外部网络,否则激活会失败!" + |
| | | "后续使用无需再调用激活,可以离线使用") |
| | | public Response activeOnline(){ |
| | | Response model = new Response(); |
| | | boolean b = FaceIdentifyUtil.active(1); |
| | | if(b){ |
| | | return new Response().set(1,true,"引擎激活成功"); |
| | | }else{ |
| | | return new Response().set(1,false,"引擎激活失败,请检查网络是否为外网并确认appId和key是否正确!"); |
| | | } |
| | | } |
| | | |
| | | @GetMapping("activeOnlinePro") |
| | | @ApiOperation(value = "在线激活人脸识别引擎,增值版使用",notes = "只需要刚开始时调用一次,会导致appId与硬件设备绑定,必须有外部网络,否则激活会失败!" + |
| | | "后续使用无需再调用激活,可以离线使用") |
| | | public Response activeOnlinePro(){ |
| | | Response model = new Response(); |
| | | boolean b = FaceIdentifyUtil.active(11); |
| | | if(b){ |
| | | return new Response().set(1,true,"引擎激活成功"); |
| | | }else{ |
| | |
| | | @GetMapping("activeOffline") |
| | | @ApiOperation(value = "离线激活人脸识别引擎,增值版使用") |
| | | public Response activeOffline(){ |
| | | Response model = new Response(); |
| | | boolean b = FaceIdentifyUtil.active(12); |
| | | boolean b = FaceIdentifyUtil.active(2); |
| | | if(b){ |
| | | return new Response().set(1,true,"引擎激活成功"); |
| | | }else{ |
| | |
| | | File jarFile = applicationHome.getDir(); |
| | | |
| | | //存储人脸图片的文件夹 |
| | | String fileDirName = jarFile.getParentFile().toString()+File.separator+"fg_photo"; |
| | | String fileDirName; |
| | | if(YamlProperties.runModel == 1) { |
| | | fileDirName = jarFile.getParentFile().toString() + File.separator + "fg_photo"; |
| | | }else{ |
| | | fileDirName = jarFile.toString() + File.separator + "fg_photo"; |
| | | } |
| | | |
| | | File file = new File(fileDirName); |
| | | //不存在则创建该文件夹 |
| | |
| | | File jarFile = applicationHome.getDir(); |
| | | |
| | | //存储人脸图片的文件夹 |
| | | String fileDirName = jarFile.getParentFile().toString()+File.separator+"fg_photo"; |
| | | String fileDirName; |
| | | if(YamlProperties.runModel == 1) { |
| | | fileDirName = jarFile.getParentFile().toString() + File.separator + "fg_photo"; |
| | | }else{ |
| | | fileDirName = jarFile.toString() + File.separator + "fg_photo"; |
| | | } |
| | | |
| | | File file = new File(fileDirName); |
| | | //不存在则创建该文件夹 |