분류데이터셋 업로드 chunk API 추가 #207
@@ -111,4 +111,34 @@ public class UploadApiController {
|
|||||||
return ApiResponseDto.ok(uploadService.getUploadStatus(statusReq));
|
return ApiResponseDto.ok(uploadService.getUploadStatus(statusReq));
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@Operation(summary = "분류 데이터셋 대용량 파일 분할 전송", description = "분류 데이터셋 파일 대용량 파일을 청크 단위로 전송합니다.")
|
||||||
|
@ApiResponses(
|
||||||
|
value = {
|
||||||
|
@ApiResponse(responseCode = "200", description = "청크 업로드 성공", content = @Content),
|
||||||
|
@ApiResponse(responseCode = "400", description = "잘못된 요청 데이터", content = @Content),
|
||||||
|
@ApiResponse(responseCode = "404", description = "업로드 세션을 찾을 수 없음", content = @Content),
|
||||||
|
@ApiResponse(responseCode = "500", description = "서버 오류", content = @Content)
|
||||||
|
})
|
||||||
|
@PostMapping(value = "/chunk-upload-cls", consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
|
||||||
|
public ApiResponseDto<UploadDto.UploadRes> uploadChunkClsDataSetFile(
|
||||||
|
@RequestParam("fileName") String fileName,
|
||||||
|
@RequestParam("fileSize") long fileSize,
|
||||||
|
@RequestParam("chunkIndex") Integer chunkIndex,
|
||||||
|
@RequestParam("chunkTotalIndex") Integer chunkTotalIndex,
|
||||||
|
@RequestPart("chunkFile") MultipartFile chunkFile,
|
||||||
|
@RequestParam("uuid") UUID uuid) {
|
||||||
|
|
||||||
|
String uploadDivi = "cls-dataset";
|
||||||
|
|
||||||
|
UploadDto.UploadAddReq upAddReqDto = new UploadDto.UploadAddReq();
|
||||||
|
upAddReqDto.setFileName(fileName);
|
||||||
|
upAddReqDto.setFileSize(fileSize);
|
||||||
|
upAddReqDto.setChunkIndex(chunkIndex);
|
||||||
|
upAddReqDto.setChunkTotalIndex(chunkTotalIndex);
|
||||||
|
upAddReqDto.setUploadDivi(uploadDivi);
|
||||||
|
upAddReqDto.setUuid(uuid);
|
||||||
|
|
||||||
|
return ApiResponseDto.ok(uploadService.uploadChunk(upAddReqDto, chunkFile));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -32,6 +32,12 @@ public class UploadService {
|
|||||||
@Value("${file.dataset-tmp-dir}")
|
@Value("${file.dataset-tmp-dir}")
|
||||||
private String datasetTmpDir;
|
private String datasetTmpDir;
|
||||||
|
|
||||||
|
@Value("${file.dataset-cls-dir}")
|
||||||
|
private String datasetClsDir;
|
||||||
|
|
||||||
|
@Value("${file.dataset-cls-tmp-dir}")
|
||||||
|
private String datasetClsTmpDir;
|
||||||
|
|
||||||
// TODO 미사용시작
|
// TODO 미사용시작
|
||||||
@Transactional
|
@Transactional
|
||||||
public DmlReturn initUpload(UploadDto.InitReq initReq) {
|
public DmlReturn initUpload(UploadDto.InitReq initReq) {
|
||||||
@@ -60,9 +66,12 @@ public class UploadService {
|
|||||||
Integer chunkTotalIndex = upAddReqDto.getChunkTotalIndex();
|
Integer chunkTotalIndex = upAddReqDto.getChunkTotalIndex();
|
||||||
String status = "UPLOADING";
|
String status = "UPLOADING";
|
||||||
|
|
||||||
if (uploadDivi.equals("dataset")) {
|
if (uploadDivi.equals("dataset")) { // 탐지데이터셋
|
||||||
tmpDataSetDir = datasetTmpDir;
|
tmpDataSetDir = datasetTmpDir;
|
||||||
fianlDir = datasetDir;
|
fianlDir = datasetDir;
|
||||||
|
} else if (uploadDivi.equals("cls-dataset")) { // 분류데이터셋
|
||||||
|
tmpDataSetDir = datasetClsTmpDir;
|
||||||
|
fianlDir = datasetClsDir;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 리턴용 파일 값
|
// 리턴용 파일 값
|
||||||
|
|||||||
@@ -53,6 +53,8 @@ file:
|
|||||||
base_path: /backup/data/training
|
base_path: /backup/data/training
|
||||||
dataset-dir: ${file.base_path}/request/
|
dataset-dir: ${file.base_path}/request/
|
||||||
dataset-tmp-dir: ${file.dataset-dir}tmp/
|
dataset-tmp-dir: ${file.dataset-dir}tmp/
|
||||||
|
dataset-cls-dir: ${file.base_path}/request/cls/
|
||||||
|
dataset-cls-tmp-dir: ${file.dataset-cls-dir}tmp/
|
||||||
|
|
||||||
pt-path: ${file.base_path}/response/v6-cls-checkpoints/
|
pt-path: ${file.base_path}/response/v6-cls-checkpoints/
|
||||||
pt-FileName: yolov8_6th-6m.pt
|
pt-FileName: yolov8_6th-6m.pt
|
||||||
|
|||||||
@@ -27,6 +27,8 @@ swagger:
|
|||||||
file:
|
file:
|
||||||
dataset-dir: /data/training/request/
|
dataset-dir: /data/training/request/
|
||||||
dataset-tmp-dir: ${file.dataset-dir}tmp/
|
dataset-tmp-dir: ${file.dataset-dir}tmp/
|
||||||
|
dataset-cls-dir: ${file.base_path}/request/cls/
|
||||||
|
dataset-cls-tmp-dir: ${file.dataset-cls-dir}tmp/
|
||||||
|
|
||||||
pt-path: /data/training/response/v6-cls-checkpoints/
|
pt-path: /data/training/response/v6-cls-checkpoints/
|
||||||
pt-FileName: yolov8_6th-6m.pt
|
pt-FileName: yolov8_6th-6m.pt
|
||||||
|
|||||||
Reference in New Issue
Block a user