浏览代码

fix: 视觉算法评估 修改结果文件为result.json

WANGKANG 7 月之前
父节点
当前提交
85b77cd849

+ 5 - 16
taais-modules/taais-biz/src/main/java/com/taais/biz/service/impl/TrackSequenceServiceImpl.java

@@ -598,14 +598,6 @@ public class TrackSequenceServiceImpl extends BaseServiceImpl<TrackSequenceMappe
                 return CommonResult.fail("数据集为空!");
             }
             evaluate_entity.setInputPath(entity.getInputPath() + ";" + entity.getOutputPath() + File.separator + "txt");
-//            if (file________.listFiles() != null && file________.listFiles().length > 0) {
-//                for (File file___________________tmp : file________.listFiles()) {
-//                    if (file___________________tmp.isDirectory()) {
-//                        evaluate_entity.setInputPath(file___________________tmp.getPath() + ";" + entity.getOutputPath() + File.separator + "txt");
-//                        break;
-//                    }
-//                }
-//            }
         } else {
             return CommonResult.fail("命名错误!");
         }
@@ -711,21 +703,18 @@ public class TrackSequenceServiceImpl extends BaseServiceImpl<TrackSequenceMappe
         String fileName_without_suffix = removeFileExtension(fileName);
 
         Path path = Paths.get(resourcePath);
-        Path resultPath = path.resolveSibling(entity.getId().toString() + BizConstant.TRACK_SEQUENCE_SUFFIX + File.separator + "evaluate_result" + File.separator + "test.csv");
+        Path resultPath = path.resolveSibling(entity.getId().toString() + BizConstant.TRACK_SEQUENCE_SUFFIX + File.separator + BizConstant.RESULT_JSON_NAME);
 
         if (!new File(resultPath.toString()).exists()) {
             return CommonResult.fail("评估结果文件不存在!");
         }
 
-        Map<String, String> map = null;
-        try {
-            map = CsvReadUtils.readCSVForLastRowAsMap(resultPath.toString(), ",");
-        } catch (Exception e) {
-            e.printStackTrace();
-            return CommonResult.fail("读取结果集失败!");
+        List<Dict> resultMap = parseJsonMapList(resultPath);
+        if (ObjectUtil.isEmpty(resultMap)) {
+            return CommonResult.fail("获取结果文件失败");
         }
 
-        return CommonResult.success(map);
+        return CommonResult.success(resultMap);
     }
 
     @Override