|
@@ -48,6 +48,7 @@ import static com.taais.biz.constant.BizConstant.VideoStatus.NOT_START;
|
|
|
import static com.taais.biz.domain.table.TrackSequenceTableDef.TRACK_SEQUENCE;
|
|
|
import static com.taais.biz.service.impl.TargetDetectionServiceImpl.getFileSize;
|
|
|
import static com.taais.biz.service.impl.TargetDetectionServiceImpl.port;
|
|
|
+import static com.taais.biz.service.impl.ToInfraredServiceImpl.getCompareImage;
|
|
|
import static com.taais.biz.service.impl.ToInfraredServiceImpl.readLogContent;
|
|
|
import static com.taais.biz.service.impl.VideoStableServiceImpl.*;
|
|
|
import static com.taais.biz.service.impl.VideoStableServiceImpl.makeDir;
|
|
@@ -498,7 +499,11 @@ public class TrackSequenceServiceImpl extends BaseServiceImpl<TrackSequenceMappe
|
|
|
HashMap<String, Object> parse = (HashMap<String, Object>) JSON.parse((params));
|
|
|
|
|
|
if ("200".equals(status) && ObjectUtil.isNull(algorithmModelTrack.getModelAddress())) {
|
|
|
- algorithmModelTrack.setModelAddress(entity.getOutputPath() + File.separator + ((HashMap<String, String>) parse.get("dataset")).get("classes"));
|
|
|
+ try {
|
|
|
+ algorithmModelTrack.setModelAddress(entity.getOutputPath() + File.separator + ((HashMap<String, String>) parse.get("dataset")).get("classes"));
|
|
|
+ }catch (Exception e) {
|
|
|
+ System.out.println("未知错误,我也不知道啥原因。。");
|
|
|
+ }
|
|
|
|
|
|
System.out.println(parse.get("dataset"));
|
|
|
algorithmModelTrackService.updateById(algorithmModelTrack);
|
|
@@ -658,4 +663,31 @@ public class TrackSequenceServiceImpl extends BaseServiceImpl<TrackSequenceMappe
|
|
|
return CommonResult.success(res, "success");
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public CommonResult previewPredictResult(Long id) {
|
|
|
+ TrackSequence entity = getById(id);
|
|
|
+
|
|
|
+ SysOssVo inputOssEntity = ossService.getById(entity.getInputOssId());
|
|
|
+
|
|
|
+ String filePath = inputOssEntity.getFileName();
|
|
|
+ String localPath = TaaisConfig.getProfile();
|
|
|
+ String resourcePath = localPath + StringUtils.substringAfter(filePath, Constants.RESOURCE_PREFIX);
|
|
|
+
|
|
|
+ String fileName = StringUtils.substringAfterLast(filePath, "/");
|
|
|
+ String fileName_without_suffix = removeFileExtension(fileName);
|
|
|
+
|
|
|
+ Path path = Paths.get(resourcePath);
|
|
|
+ Path inputPath = path.resolveSibling(fileName_without_suffix + BizConstant.UNZIP_SUFFIX + File.separator + "images");
|
|
|
+ Path outputPath = path.resolveSibling(entity.getId().toString() + BizConstant.TRACK_SEQUENCE_SUFFIX + File.separator + "gaze" + File.separator + "images");
|
|
|
+
|
|
|
+ File outputPathDir = new File(outputPath.toString());
|
|
|
+ if(!outputPathDir.exists()) {
|
|
|
+ outputPath = path.resolveSibling(entity.getId().toString() + BizConstant.TRACK_SEQUENCE_SUFFIX + File.separator + "images");
|
|
|
+ }
|
|
|
+
|
|
|
+ String urlPrefix = inputOssEntity.getUrl().substring(0, inputOssEntity.getUrl().indexOf(Constants.RESOURCE_PREFIX) + Constants.RESOURCE_PREFIX.length());
|
|
|
+
|
|
|
+ return getCompareImage(urlPrefix, inputPath.toString(), outputPath.toString());
|
|
|
+ }
|
|
|
+
|
|
|
}
|