Quellcode durchsuchen

fix: 解决训练路径没有解压压缩包的问题

WANGKANG vor 3 Wochen
Ursprung
Commit
75c698f335

+ 7 - 6
taais-modules/taais-biz/src/main/java/com/taais/biz/service/impl/TargetDetectionServiceImpl.java

@@ -204,6 +204,13 @@ public class TargetDetectionServiceImpl extends BaseServiceImpl<TargetDetectionM
             throw new RuntimeException("算法配置参数为空");
         }
 
+        String unzipPath = getUnZipDirPath(ossEntity);
+        File file = new File(unzipPath);
+        if (!file.exists()) {
+            String resourcePath = getResourcePath(ossService.getById(entity.getInputOssId()));
+            ZipUtils.unzip(resourcePath, unzipPath);
+        }
+
         Map<String, Object> algorithmParameters = getAlgorithmParameters(algorithmConfig.getParameters(),
             entityBo.getOtherParams());
 
@@ -241,12 +248,6 @@ public class TargetDetectionServiceImpl extends BaseServiceImpl<TargetDetectionM
         // 步骤 5. 将算法参数map序列化为json字符串,保存到数据库中
         entity.setAlgorithmParameters(JsonUtils.toJsonString(result));
 
-        File file = new File(entity.getInputPath());
-        if (!file.exists()) {
-            String resourcePath = getResourcePath(ossService.getById(entity.getInputOssId()));
-            ZipUtils.unzip(resourcePath, entity.getInputPath());
-        }
-
         makeDir(entity.getInputPath());
         makeDir(entity.getOutputPath());
 

+ 7 - 6
taais-modules/taais-biz/src/main/java/com/taais/biz/service/impl/TrackSequenceServiceImpl.java

@@ -273,6 +273,13 @@ public class TrackSequenceServiceImpl extends BaseServiceImpl<TrackSequenceMappe
             throw new RuntimeException("算法配置参数为空");
         }
 
+        String unzipPath = getUnZipDirPath(ossEntity);
+        File file = new File(unzipPath);
+        if (!file.exists()) {
+            String resourcePath = getResourcePath(ossService.getById(entity.getInputOssId()));
+            ZipUtils.unzip(resourcePath, unzipPath);
+        }
+
         Map<String, Object> algorithmParameters = getAlgorithmParameters(algorithmConfig.getParameters(),
             entityBo.getOtherParams());
 
@@ -340,12 +347,6 @@ public class TrackSequenceServiceImpl extends BaseServiceImpl<TrackSequenceMappe
         // 步骤 5. 将算法参数map序列化为json字符串,保存到数据库中
         entity.setAlgorithmParameters(JsonUtils.toJsonString(result));
 
-        File file = new File(entity.getInputPath());
-        if (!file.exists()) {
-            String resourcePath = getResourcePath(ossService.getById(entity.getInputOssId()));
-            ZipUtils.unzip(resourcePath, entity.getInputPath());
-        }
-
         makeDir(entity.getInputPath());
         makeDir(entity.getOutputPath());