|
@@ -244,7 +244,10 @@ public class ToInfraredServiceImpl extends BaseServiceImpl<ToInfraredMapper, ToI
|
|
|
makeDir(inputPath.toString());
|
|
|
makeDir(outputPath.toString());
|
|
|
|
|
|
- ZipUtils.unzip(resourcePath, inputPath.toString());
|
|
|
+ File file = new File(resourcePath);
|
|
|
+ if (!file.exists()) {
|
|
|
+ ZipUtils.unzip(resourcePath, inputPath.toString());
|
|
|
+ }
|
|
|
|
|
|
toInfrared.setInputPath(inputPath.toString());
|
|
|
toInfrared.setOutputPath(outputPath.toString());
|
|
@@ -262,8 +265,8 @@ public class ToInfraredServiceImpl extends BaseServiceImpl<ToInfraredMapper, ToI
|
|
|
|
|
|
String osName = System.getProperty("os.name");
|
|
|
if (osName.toLowerCase().contains("windows")) {
|
|
|
- startToInfraredTask.setSource_dir("C://" + toInfrared.getInputPath());
|
|
|
- startToInfraredTask.setResult_dir("C://" + toInfrared.getOutputPath());
|
|
|
+ startToInfraredTask.setSource_dir("C:" + toInfrared.getInputPath());
|
|
|
+ startToInfraredTask.setResult_dir("C:" + toInfrared.getOutputPath());
|
|
|
} else {
|
|
|
startToInfraredTask.setSource_dir(toInfrared.getInputPath());
|
|
|
startToInfraredTask.setResult_dir(toInfrared.getOutputPath());
|
|
@@ -272,7 +275,7 @@ public class ToInfraredServiceImpl extends BaseServiceImpl<ToInfraredMapper, ToI
|
|
|
// startToInfraredTask.setSource_dir(toInfrared.getInputPath());
|
|
|
// startToInfraredTask.setResult_dir(toInfrared.getOutputPath());
|
|
|
|
|
|
- if (algorithmConfigTrack.getType() == BizConstant.AlgorithmType.REASONING) {
|
|
|
+ if ( BizConstant.AlgorithmType.REASONING.equals(algorithmConfigTrack.getType())) {
|
|
|
startToInfraredTask.setModel_path(algorithmModelTrack.getModelAddress());
|
|
|
}
|
|
|
|
|
@@ -318,6 +321,30 @@ public class ToInfraredServiceImpl extends BaseServiceImpl<ToInfraredMapper, ToI
|
|
|
entity.setCostSecond(null);
|
|
|
}
|
|
|
updateById(entity);
|
|
|
+ /*
|
|
|
+ * 这里有很多需要做的:1. 保存所有模型到oss 2. 模型文件保存到算法模型配置表中
|
|
|
+ */
|
|
|
+/*
|
|
|
+ Path resultsPath = Paths.get(entity.getInputPath());
|
|
|
+ Path modelPath = resultsPath.resolve(BizConstant.MODEL_PATH);
|
|
|
+
|
|
|
+ File modelDir = new File(modelPath.toString());
|
|
|
+
|
|
|
+ if(!modelDir.exists() || !modelDir.isDirectory()) {
|
|
|
+ return CommonResult.fail("模型文件不存在");
|
|
|
+ }
|
|
|
+
|
|
|
+ for (File f : modelDir.listFiles()) {
|
|
|
+ if (f.isFile() && f.getName().endsWith(BizConstant.MODEL_SUFFIX)) {
|
|
|
+ SysOssVo upload = ossService.upload(f);
|
|
|
+ AlgorithmModelTrack algorithmModelTrack = new AlgorithmModelTrack();
|
|
|
+ algorithmModelTrack.set
|
|
|
+ algorithmModelTrackService.insert();
|
|
|
+ }
|
|
|
+ }
|
|
|
+*/
|
|
|
+
|
|
|
+
|
|
|
return CommonResult.success();
|
|
|
}
|
|
|
|