|
@@ -18,6 +18,7 @@ import com.mybatisflex.core.query.QueryWrapper;
|
|
|
import com.taais.biz.constant.BizConstant;
|
|
|
import com.taais.biz.domain.*;
|
|
|
import com.taais.biz.domain.vo.*;
|
|
|
+import com.taais.biz.utils.CsvReadUtils;
|
|
|
import com.taais.biz.utils.ZipUtils;
|
|
|
import com.taais.common.core.config.TaaisConfig;
|
|
|
import com.taais.common.core.constant.Constants;
|
|
@@ -388,7 +389,7 @@ public class TrackSequenceServiceImpl extends BaseServiceImpl<TrackSequenceMappe
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- if (!(flag && !false && (1!=2) && (1 == 1))) {
|
|
|
+ if (!(flag && !false && (1 != 2) && (1 == 1))) {
|
|
|
return CommonResult.fail("数据集错误!!!!!!");
|
|
|
}
|
|
|
}
|
|
@@ -501,7 +502,7 @@ public class TrackSequenceServiceImpl extends BaseServiceImpl<TrackSequenceMappe
|
|
|
if ("200".equals(status) && ObjectUtil.isNull(algorithmModelTrack.getModelAddress())) {
|
|
|
try {
|
|
|
algorithmModelTrack.setModelAddress(entity.getOutputPath() + File.separator + ((HashMap<String, String>) parse.get("dataset")).get("classes"));
|
|
|
- }catch (Exception e) {
|
|
|
+ } catch (Exception e) {
|
|
|
System.out.println("未知错误,我也不知道啥原因。。");
|
|
|
}
|
|
|
|
|
@@ -680,8 +681,8 @@ public class TrackSequenceServiceImpl extends BaseServiceImpl<TrackSequenceMappe
|
|
|
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()) {
|
|
|
+ File outputPathDir = new File(outputPath.toString());
|
|
|
+ if (!outputPathDir.exists()) {
|
|
|
outputPath = path.resolveSibling(entity.getId().toString() + BizConstant.TRACK_SEQUENCE_SUFFIX + File.separator + "images");
|
|
|
}
|
|
|
|
|
@@ -690,4 +691,35 @@ public class TrackSequenceServiceImpl extends BaseServiceImpl<TrackSequenceMappe
|
|
|
return getCompareImage(urlPrefix, inputPath.toString(), outputPath.toString());
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public CommonResult previewEvaluateResult(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 resultPath = path.resolveSibling(entity.getId().toString() + BizConstant.TRACK_SEQUENCE_SUFFIX + File.separator + "evaluate_result" + File.separator + "test.csv");
|
|
|
+
|
|
|
+ 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("读取结果集失败!");
|
|
|
+ }
|
|
|
+
|
|
|
+ return CommonResult.success(map);
|
|
|
+ }
|
|
|
+
|
|
|
}
|