|
@@ -487,34 +487,10 @@ public class TrackSequenceServiceImpl extends BaseServiceImpl<TrackSequenceMappe
|
|
|
}
|
|
|
updateById(entity);
|
|
|
|
|
|
- AlgorithmModelTrack algorithmModelTrack = algorithmModelTrackService.getById(entity.getAlgorithmModelId());
|
|
|
- algorithmModelTrack
|
|
|
- .setModelStatus("200".equals(status) ? BizConstant.ModelStatus.END : BizConstant.ModelStatus.FAILED);
|
|
|
-
|
|
|
- AlgorithmConfigTrack algorithmConfigTrack = algorithmConfigTrackService
|
|
|
- .getById(algorithmModelTrack.getAlgorithmId());
|
|
|
- String params = algorithmConfigTrack.getParameterConfig();
|
|
|
- HashMap<String, Object> parse = (HashMap<String, Object>) JSON.parse((params));
|
|
|
-
|
|
|
- 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) {
|
|
|
- System.out.println("未知错误");
|
|
|
- }
|
|
|
-
|
|
|
- System.out.println(parse.get("dataset"));
|
|
|
- algorithmModelTrackService.updateById(algorithmModelTrack);
|
|
|
- }
|
|
|
WebSocketUtils.publishAll("refresh");
|
|
|
return CommonResult.success();
|
|
|
}
|
|
|
|
|
|
- private String getLogFileName(TrackSequence entity) {
|
|
|
- return entity.getId() + BizConstant.TRACK_SEQUENCE_SUFFIX + ".log";
|
|
|
- }
|
|
|
-
|
|
|
@Override
|
|
|
public CommonResult getLog(Long id) {
|
|
|
TrackSequence entity = getById(id);
|
|
@@ -560,58 +536,6 @@ public class TrackSequenceServiceImpl extends BaseServiceImpl<TrackSequenceMappe
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- @Override
|
|
|
- public CommonResult addEvaluate(AddEvaluate addEvaluate) {
|
|
|
- AlgorithmConfigTrackVo config = algorithmConfigTrackService.selectById(addEvaluate.getAlgorithmId());
|
|
|
- if (ObjectUtil.isNull(config)) {
|
|
|
- throw new RuntimeException("算法不存在");
|
|
|
- }
|
|
|
-
|
|
|
- TrackSequence entity = this.getById(addEvaluate.getId());
|
|
|
- TrackSequence evaluate_entity = new TrackSequence();
|
|
|
- evaluate_entity.setStatus(NOT_START);
|
|
|
- evaluate_entity.setUrl(entity.getUrl());
|
|
|
- if (addEvaluate.getName().startsWith(MASC)) {
|
|
|
- evaluate_entity.setInputPath(entity.getInputPath() + ";" +
|
|
|
- entity.getOutputPath() + File.separator + "gaze"
|
|
|
- + File.separator + "txt");
|
|
|
- } else if (addEvaluate.getName().startsWith(CAT)) {
|
|
|
- File file________ = new File(entity.getInputPath());
|
|
|
- if (!file________.exists()) {
|
|
|
- return CommonResult.fail("数据集为空!");
|
|
|
- }
|
|
|
- evaluate_entity.setInputPath(entity.getInputPath() + ";" +
|
|
|
- entity.getOutputPath() + File.separator + "txt");
|
|
|
- } else {
|
|
|
- return CommonResult.fail("命名错误!");
|
|
|
- }
|
|
|
- evaluate_entity.setZipFilePath(entity.getZipFilePath());
|
|
|
- evaluate_entity.setAlgorithmModelId(entity.getAlgorithmModelId());
|
|
|
- evaluate_entity.setInputOssId(entity.getInputOssId());
|
|
|
-
|
|
|
- evaluate_entity.setName(addEvaluate.getName());
|
|
|
- evaluate_entity.setAlgorithmId(addEvaluate.getAlgorithmId());
|
|
|
- evaluate_entity.setRemarks(addEvaluate.getRemarks());
|
|
|
-
|
|
|
- boolean flag__ = save(evaluate_entity);
|
|
|
-
|
|
|
- if (flag__) {
|
|
|
- Path path = Paths.get(entity.getOutputPath());
|
|
|
- evaluate_entity.setOutputPath(path
|
|
|
- .resolveSibling(evaluate_entity.getId().toString() +
|
|
|
- BizConstant.TRACK_SEQUENCE_SUFFIX)
|
|
|
- .toString());
|
|
|
- boolean flag___ = updateById(evaluate_entity);
|
|
|
- if (flag___) {
|
|
|
- return CommonResult.success("新增评估任务成功!");
|
|
|
- } else {
|
|
|
- return CommonResult.success("新增评估任务成功! 更新输出路径失败");
|
|
|
- }
|
|
|
- } else {
|
|
|
- return CommonResult.success("新增评估任务失败!");
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
@Override
|
|
|
public CommonResult getModelList(Long id) {
|
|
|
TrackSequence entity = getById(id);
|