Browse Source

优化从label studio导出测试

dev-credits
chenzhihang 1 year ago
parent
commit
224d496999
1 changed files with 3 additions and 2 deletions
  1. +3
    -2
      ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/service/impl/NewDatasetServiceImpl.java

+ 3
- 2
ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/service/impl/NewDatasetServiceImpl.java View File

@@ -473,12 +473,13 @@ public class NewDatasetServiceImpl implements NewDatasetService {
public String newCreateVersionFromLabelStudio(LabelDatasetVersionVo labelDatasetVersionVo) throws Exception {
// 1. 下载数据集文件
// 获取label-studio数据流
Map<String, String> headers = new HashMap<String, String>();
Map<String, String> headers = new HashMap<>();
headers.put("Authorization", "Token " + labelDatasetVersionVo.getToken());
InputStream inputStream = HttpUtils.getIntputStream(labelloaclUrl + "/api/projects/" + labelDatasetVersionVo.getProjectId() + "/export?exportType=" + labelDatasetVersionVo.getExportType(), headers);

// 2. 打包成zip包
String zipFileName = labelDatasetVersionVo.getName()+"_"+labelDatasetVersionVo.getVersion() + ".zip";
// String zipFileName = labelDatasetVersionVo.getName() + "_" + labelDatasetVersionVo.getVersion() + ".zip";
String zipFileName = labelDatasetVersionVo.getName() + "_" + labelDatasetVersionVo.getVersion();
MultipartFile[] files = FileUtil.toMultipartFiles(inputStream, zipFileName);

// 3. 上传到minio


Loading…
Cancel
Save