|
@@ -677,20 +677,37 @@ public class AlgorithmTaskServiceImpl extends BaseServiceImpl<AlgorithmTaskMappe
|
|
|
int errorCount = 0;
|
|
|
for (DataVo dataVo : trainDataList) {
|
|
|
// 复制图片
|
|
|
- String imagePath = StringUtils.substringAfter(dataVo.getUrl(), Constants.RESOURCE_PREFIX);
|
|
|
+ String imagePath = TaaisConfig.getProfile() + StringUtils.substringAfter(dataVo.getUrl(), Constants.RESOURCE_PREFIX);
|
|
|
+ String destPath = TaaisConfig.getProfile() + destinationPath+BizConstant.IMAGE;
|
|
|
+ String osName = System.getProperty("os.name").toLowerCase();
|
|
|
try {
|
|
|
- FileUtils.copyFile(TaaisConfig.getProfile() + imagePath, TaaisConfig.getProfile() + destinationPath+BizConstant.IMAGE);
|
|
|
+ if (osName.contains("win")) {
|
|
|
+ } else {
|
|
|
+ // Linux/Unix 环境
|
|
|
+ imagePath = imagePath.replaceAll("/", "\\\\");
|
|
|
+ destPath = destPath.replaceAll("/", "\\\\");
|
|
|
+ }
|
|
|
+ FileUtils.copyFile(imagePath, destPath);
|
|
|
+ log.info("复制图片文件成功source:{},target:{}", imagePath, destPath);
|
|
|
} catch (IOException e) {
|
|
|
errorCount++;
|
|
|
- log.error("复制图片文件出错source:{},target:{}", dataVo.getDataSource(), TaaisConfig.getProfile() + destinationPath);
|
|
|
+ log.error("复制图片文件出错source:{},target:{}", imagePath, destPath, e);
|
|
|
}
|
|
|
if(dataVo.getLabeled()){
|
|
|
+ String txtPathStr = FileUtils.getTxtPathStr(imagePath);
|
|
|
+ String destLabelPath = TaaisConfig.getProfile() + destinationPath+BizConstant.LABEL;
|
|
|
+ if (osName.contains("win")) {
|
|
|
+ } else {
|
|
|
+ // Linux/Unix 环境
|
|
|
+ txtPathStr = txtPathStr.replaceAll("/", "\\\\");
|
|
|
+ destLabelPath = destLabelPath.replaceAll("/", "\\\\");
|
|
|
+ }
|
|
|
try {
|
|
|
- String txtPathStr = FileUtils.getTxtPathStr(imagePath);
|
|
|
- FileUtils.copyFile(txtPathStr, TaaisConfig.getProfile() + destinationPath+BizConstant.LABEL);
|
|
|
+ FileUtils.copyFile(txtPathStr, destLabelPath);
|
|
|
+ log.info("复制标注文件成功source:{},target:{}", imagePath, destLabelPath);
|
|
|
} catch (IOException e) {
|
|
|
errorCount++;
|
|
|
- log.error("复制标注文件出错source:{},target:{}", dataVo.getDataSource(), TaaisConfig.getProfile() + destinationPath);
|
|
|
+ log.error("复制标注文件出错source:{},target:{}", txtPathStr, destLabelPath,e);
|
|
|
}
|
|
|
}
|
|
|
|