unknown преди 8 месеца
родител
ревизия
6eab843ae7

+ 2 - 2
taais-admin/src/main/resources/application.yml

@@ -9,8 +9,8 @@ taais:
   # 实例演示开关
   demoEnabled: true
   # 文件路径 示例( Windows配置D:/km/uploadPath,Linux配置 /home/km/uploadPath)
-  # profile: D:/taais/uploadPath
-  profile: /home/ObjectDetection_Web
+  profile: D:/taais/uploadPath
+  #profile: /home/ObjectDetection_Web
   # 获取ip地址开关
   addressEnabled: false
   video_stable_url: http://localhost:11001/video_stable

+ 9 - 9
taais-modules/taais-biz/src/main/java/com/taais/biz/controller/DataAugmentationController.java

@@ -79,15 +79,15 @@ public class DataAugmentationController extends BaseController {
             Path outputPath = null;
             String osName = System.getProperty("os.name");
             // 判断是否是Windows环境
-            if (osName.toLowerCase().contains("windows")) {
-                inputPath = Paths.get("C:", dataAugmentation.getInputPath());
-                outputPath = Paths.get("C:", dataAugmentation.getOutputPath());
-            } else {
-                inputPath = Paths.get(dataAugmentation.getInputPath());
-                outputPath = Paths.get(dataAugmentation.getOutputPath());
-            }
-//            inputPath = Paths.get(dataAugmentation.getInputPath());
-//            outputPath = Paths.get(dataAugmentation.getOutputPath());
+//            if (osName.toLowerCase().contains("windows")) {
+//                inputPath = Paths.get("D:", dataAugmentation.getInputPath());
+//                outputPath = Paths.get("D:", dataAugmentation.getOutputPath());
+//            } else {
+//                inputPath = Paths.get(dataAugmentation.getInputPath());
+//                outputPath = Paths.get(dataAugmentation.getOutputPath());
+//            }
+            inputPath = Paths.get(dataAugmentation.getInputPath());
+            outputPath = Paths.get(dataAugmentation.getOutputPath());
             System.out.println("inputPath: " + inputPath.toString());
             System.out.println("outputPath: " + outputPath.toString());
             Path imagePath = getImageAtPathIdx(inputPath, idx);

+ 33 - 26
taais-modules/taais-biz/src/main/java/com/taais/biz/service/impl/DataAugmentationServiceImpl.java

@@ -233,26 +233,32 @@ public class DataAugmentationServiceImpl extends BaseServiceImpl<DataAugmentatio
 
         String fileName = StringUtils.substringAfterLast(filePath, "/");
         String fileName_without_suffix = removeFileExtension(fileName);
-
-        Path path = Paths.get(resourcePath);
-        Path inputPath = path.resolveSibling(fileName_without_suffix + "_images");
-        Path outputPath = path.resolveSibling(fileName_without_suffix + "_stable");
-        Path logPath = path.resolveSibling(fileName_without_suffix + "_log");
+        Path path = null;
+        Path inputPath = null;
+        Path outputPath = null;
+        Path logPath = null;
+//        Path path = Paths.get();
+        //String osName = System.getProperty("os.name");
+         //判断是否是Windows环境
+//        if (osName.toLowerCase().contains("windows")) {
+//            path = Paths.get("D:", resourcePath);
+//        } else {
+//            path = Paths.get(resourcePath);
+//
+//        }
+        path = Paths.get(resourcePath);
+        inputPath = path.resolveSibling(fileName_without_suffix + "_input");
+        outputPath = path.resolveSibling(fileName_without_suffix + "_output");
+        logPath = path.resolveSibling(fileName_without_suffix + "_log");
         makeDir(inputPath.toString());
         makeDir(outputPath.toString());
-        makeDir(localPath.toString());
-        //本地测试代码
-//        String inputPath = "D:\\program\\taais\\duijie\\code-niguang\\" + fileName_without_suffix + "_images";
-//        String outputPath = "D:\\program\\taais\\duijie\\code-niguang\\" + fileName_without_suffix + "_output";
-//        String logPath = "D:\\program\\taais\\duijie\\code-niguang\\" + fileName_without_suffix + "_log";
-//        makeDir(inputPath.toString());
-//        makeDir(outputPath.toString());
-//        makeDir(logPath.toString());
-//        Path path = Paths.get(inputPath);
+        makeDir(logPath.toString());
+
+        System.out.println("inputPath:" + inputPath.toString());
         ZipUtils.unzip(resourcePath, inputPath.toString());
         //获取inputPath的下一级目录
         if (Files.exists(inputPath) && Files.isDirectory(inputPath)) {
-            try (DirectoryStream<Path> stream = Files.newDirectoryStream(path)) {
+            try (DirectoryStream<Path> stream = Files.newDirectoryStream(inputPath)) {
                 // 遍历目录流以找到第一个子目录
                 for (Path entry : stream) {
                     if (Files.isDirectory(entry)) {
@@ -284,7 +290,7 @@ public class DataAugmentationServiceImpl extends BaseServiceImpl<DataAugmentatio
         TransmissionObject transmissionObject = new TransmissionObject();
         transmissionObject.setBizId(dataAugmentation.getId());
         transmissionObject.setBizType(dataAugmentation.getTaskType());
-        transmissionObject.setLogPath(dataAugmentation.getLog());
+        transmissionObject.setLogPath(dataAugmentation.getAlgorithmPath());
         transmissionObject.setSourcePath(dataAugmentation.getInputPath());
         transmissionObject.setResultPath(dataAugmentation.getOutputPath());
         transmissionObject.setOtherParams(dataAugmentation.getHyperparameterConfiguration());
@@ -350,17 +356,18 @@ public class DataAugmentationServiceImpl extends BaseServiceImpl<DataAugmentatio
 
         Path inputPath = null;
         Path outputPath = null;
-        String osName = System.getProperty("os.name");
+//        String osName = System.getProperty("os.name");
         // 判断是否是Windows环境
-        if (osName.toLowerCase().contains("windows")) {
-            inputPath = Paths.get("C:", dataAugmentation.getInputPath());
-            outputPath = Paths.get("C:", dataAugmentation.getOutputPath());
-        } else {
-            inputPath = Paths.get(dataAugmentation.getInputPath());
-            outputPath = Paths.get(dataAugmentation.getOutputPath());
-        }
-//        inputPath = Paths.get(dataAugmentation.getInputPath());
-//        outputPath = Paths.get(dataAugmentation.getOutputPath());
+//        if (osName.toLowerCase().contains("windows")) {
+//            inputPath = Paths.get("D:", dataAugmentation.getInputPath());
+//            outputPath = Paths.get("D:", dataAugmentation.getOutputPath());
+//        } else {
+//            inputPath = Paths.get(dataAugmentation.getInputPath());
+//            outputPath = Paths.get(dataAugmentation.getOutputPath());
+//        }
+
+        inputPath = Paths.get(dataAugmentation.getInputPath());
+        outputPath = Paths.get(dataAugmentation.getOutputPath());
         // 创建File对象
         File in_directory = new File(inputPath.toString());
         File out_directory = new File(outputPath.toString());