人脸识别修改调用脚本路径,页面增加查看时可新增

This commit is contained in:
zhanghongqing
2018-11-27 17:56:01 +08:00
parent 80e6bbb53d
commit 204a1d5c93
4 changed files with 33 additions and 9 deletions

View File

@@ -624,13 +624,18 @@ public class AvController extends BaseController {
*/
@ResponseBody
@RequestMapping(value = {"/sample/faceToPicture"})
public Map faceToPicture(Model model,@RequestParam("srcFile") CommonsMultipartFile[] srcFile){
public Map faceToPicture(Model model,@RequestParam("srcFile") CommonsMultipartFile[] srcFile,@RequestParam("faceFilePath")String faceFilePath){
String sep = System.getProperty("file.separator");
String random = UUID.randomUUID()+"";
// String srcFilePath = Constants.AV_FILE_PATH+"face"+random+sep+"srcFile";//视频源文件保存路径
String srcFilePath = StringUtils.getUserfilesBaseDir()+"face"+sep+"picFile"+sep+random+sep;//视频生成的关键帧图片文件保存路径
FileUtils.createDirectory(srcFilePath);
String srcFilePath="";
if(StringUtil.isBlank(faceFilePath)){
srcFilePath = StringUtils.getUserfilesBaseDir()+"face"+sep+"picFile"+sep+random+sep;//视频生成的关键帧图片文件保存路径
faceFilePath=srcFilePath;
FileUtils.createDirectory(srcFilePath);
}else{
srcFilePath=faceFilePath;
}
//保存源文件
for (CommonsMultipartFile sinFile : srcFile) {
String r = UUID.randomUUID()+"";
@@ -647,6 +652,7 @@ public class AvController extends BaseController {
Map map = new HashMap();
map.put("picFilePath", srcFilePath);
map.put("faceFilePath", faceFilePath);
//获取图片列表
Collection<File> files = FileUtils.listFiles(new File(srcFilePath), null, true);