diff --git a/label/label-to-review/.gradle/buildOutputCleanup/buildOutputCleanup.lock b/label/label-to-review/.gradle/buildOutputCleanup/buildOutputCleanup.lock index 68644f4..bc04f09 100644 Binary files a/label/label-to-review/.gradle/buildOutputCleanup/buildOutputCleanup.lock and b/label/label-to-review/.gradle/buildOutputCleanup/buildOutputCleanup.lock differ diff --git a/label/label-to-review/.gradle/file-system.probe b/label/label-to-review/.gradle/file-system.probe index 363e865..9a4dc8c 100644 Binary files a/label/label-to-review/.gradle/file-system.probe and b/label/label-to-review/.gradle/file-system.probe differ diff --git a/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/scheduler/service/TrainingDataLabelJobService.class b/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/scheduler/service/TrainingDataLabelJobService.class index dd5aa1e..0ba19d4 100644 Binary files a/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/scheduler/service/TrainingDataLabelJobService.class and b/label/label-to-review/build/classes/java/main/com/kamco/cd/kamcoback/scheduler/service/TrainingDataLabelJobService.class differ diff --git a/label/label-to-review/build/tmp/compileJava/previous-compilation-data.bin b/label/label-to-review/build/tmp/compileJava/previous-compilation-data.bin index f0aac97..5325165 100644 Binary files a/label/label-to-review/build/tmp/compileJava/previous-compilation-data.bin and b/label/label-to-review/build/tmp/compileJava/previous-compilation-data.bin differ diff --git a/label/label-to-review/src/main/java/com/kamco/cd/kamcoback/scheduler/service/TrainingDataLabelJobService.java b/label/label-to-review/src/main/java/com/kamco/cd/kamcoback/scheduler/service/TrainingDataLabelJobService.java index a5f3336..82663b1 100644 --- a/label/label-to-review/src/main/java/com/kamco/cd/kamcoback/scheduler/service/TrainingDataLabelJobService.java +++ b/label/label-to-review/src/main/java/com/kamco/cd/kamcoback/scheduler/service/TrainingDataLabelJobService.java @@ -15,7 +15,6 @@ import lombok.RequiredArgsConstructor; import lombok.extern.log4j.Log4j2; import org.springframework.beans.factory.annotation.Value; import org.springframework.context.ApplicationContext; -import org.springframework.scheduling.annotation.Scheduled; import org.springframework.stereotype.Service; @Log4j2 @@ -36,8 +35,8 @@ public class TrainingDataLabelJobService { public void runTask() { // 프록시를 통해 호출해야 @Transactional이 적용됨 applicationContext - .getBean(TrainingDataLabelJobService.class) - .assignReviewerYesterdayLabelComplete(null); + .getBean(TrainingDataLabelJobService.class) + .assignReviewerYesterdayLabelComplete(null); } @Transactional @@ -48,7 +47,7 @@ public class TrainingDataLabelJobService { log.info("=== baseDate : {}", baseDate); log.info("=== baseDate 있으면 해당 일자, 없으면 어제일자로 조회"); List tasks = - trainingDataLabelJobCoreService.findCompletedYesterdayUnassigned(baseDate); + trainingDataLabelJobCoreService.findCompletedYesterdayUnassigned(baseDate); log.info("[Step 1-2] 목록 객체 건수 count : {}", tasks == null ? 0 : tasks.size()); if (tasks.isEmpty()) { @@ -59,7 +58,7 @@ public class TrainingDataLabelJobService { // 회차별로 그룹핑 log.info("[Step 2-1] 회차별로 그룹핑 시작"); Map> taskByRound = - tasks.stream().collect(Collectors.groupingBy(Tasks::getAnalUid)); + tasks.stream().collect(Collectors.groupingBy(Tasks::getAnalUid)); // 회차별 분배 log.info("[Step 3-1] 회차별로 분배 시작"); @@ -71,7 +70,7 @@ public class TrainingDataLabelJobService { log.info("[Step 3-2] 수행하는 회차 analUid: {}", analUid); log.info("해당 회차에 라벨링 할당받은 검수자별 완료 건수 count(), 완료한 게 적은 순으로 해야 일이 한 사람에게 몰리지 않음"); List pendings = - trainingDataLabelJobCoreService.findInspectorPendingByRound(analUid); + trainingDataLabelJobCoreService.findInspectorPendingByRound(analUid); log.info("검수자 수: {}", pendings == null ? 0 : pendings.size()); if (pendings.isEmpty()) { @@ -81,7 +80,7 @@ public class TrainingDataLabelJobService { log.info("[Step 4-1] 검수자 사번 List 생성"); List reviewerIds = - pendings.stream().map(InspectorPendingDto::getInspectorUid).toList(); + pendings.stream().map(InspectorPendingDto::getInspectorUid).toList(); // Lock 걸릴 수 있기 때문에 엔티티 조회하는 Repository 에서 구현 log.info("[Step 4-2] 검수자 테이블 lock 걸리지 않게 처리"); @@ -95,23 +94,23 @@ public class TrainingDataLabelJobService { // reviewer별 batch update log.info("[Step 5-3] 검수자별 할당 데이터를 batch update 시작"); assignMap.forEach( - (reviewerId, assignedTasks) -> { - if (assignedTasks.isEmpty()) { - log.info("[Step 5-4] 할당된 데이터 없으면 return"); - return; - } + (reviewerId, assignedTasks) -> { + if (assignedTasks.isEmpty()) { + log.info("[Step 5-4] 할당된 데이터 없으면 return"); + return; + } - List assignmentUids = - assignedTasks.stream().map(Tasks::getAssignmentUid).toList(); - log.info("[Step 6-1] 할당 작업에 검수자 아이디 update"); - log.info("==== 검수자 사번: {}", reviewerId); - log.info("==== 할당 갯수: {}", assignmentUids == null ? 0 : assignmentUids.size()); - trainingDataLabelJobCoreService.assignReviewerBatch(assignmentUids, reviewerId); + List assignmentUids = + assignedTasks.stream().map(Tasks::getAssignmentUid).toList(); + log.info("[Step 6-1] 할당 작업에 검수자 아이디 update"); + log.info("==== 검수자 사번: {}", reviewerId); + log.info("==== 할당 갯수: {}", assignmentUids == null ? 0 : assignmentUids.size()); + trainingDataLabelJobCoreService.assignReviewerBatch(assignmentUids, reviewerId); - log.info("[Step 7-1] geom 테이블에 검수 상태 update"); - List geomUids = assignedTasks.stream().map(Tasks::getInferenceUid).toList(); - trainingDataLabelJobCoreService.updateGeomUidTestState(geomUids); - }); + log.info("[Step 7-1] geom 테이블에 검수 상태 update"); + List geomUids = assignedTasks.stream().map(Tasks::getInferenceUid).toList(); + trainingDataLabelJobCoreService.updateGeomUidTestState(geomUids); + }); } } catch (Exception e) { log.error("배치 처리 중 예외", e); @@ -120,7 +119,7 @@ public class TrainingDataLabelJobService { } private Map> distributeByLeastPending( - List tasks, List reviewerIds) { + List tasks, List reviewerIds) { Map> result = new LinkedHashMap<>(); // 순서 유지 중요 (ASC 정렬된 상태) diff --git a/label/review-to-geojson/.gradle/9.3.1/executionHistory/executionHistory.bin b/label/review-to-geojson/.gradle/9.3.1/executionHistory/executionHistory.bin index c97e926..2e2499a 100644 Binary files a/label/review-to-geojson/.gradle/9.3.1/executionHistory/executionHistory.bin and b/label/review-to-geojson/.gradle/9.3.1/executionHistory/executionHistory.bin differ diff --git a/label/review-to-geojson/.gradle/9.3.1/executionHistory/executionHistory.lock b/label/review-to-geojson/.gradle/9.3.1/executionHistory/executionHistory.lock index 8bce03b..60dad19 100644 Binary files a/label/review-to-geojson/.gradle/9.3.1/executionHistory/executionHistory.lock and b/label/review-to-geojson/.gradle/9.3.1/executionHistory/executionHistory.lock differ diff --git a/label/review-to-geojson/.gradle/9.3.1/fileHashes/fileHashes.bin b/label/review-to-geojson/.gradle/9.3.1/fileHashes/fileHashes.bin index 634b7a8..0f8ac9b 100644 Binary files a/label/review-to-geojson/.gradle/9.3.1/fileHashes/fileHashes.bin and b/label/review-to-geojson/.gradle/9.3.1/fileHashes/fileHashes.bin differ diff --git a/label/review-to-geojson/.gradle/9.3.1/fileHashes/fileHashes.lock b/label/review-to-geojson/.gradle/9.3.1/fileHashes/fileHashes.lock index 7de3950..ee84508 100644 Binary files a/label/review-to-geojson/.gradle/9.3.1/fileHashes/fileHashes.lock and b/label/review-to-geojson/.gradle/9.3.1/fileHashes/fileHashes.lock differ diff --git a/label/review-to-geojson/.gradle/9.3.1/fileHashes/resourceHashesCache.bin b/label/review-to-geojson/.gradle/9.3.1/fileHashes/resourceHashesCache.bin index cc0d043..bf569e0 100644 Binary files a/label/review-to-geojson/.gradle/9.3.1/fileHashes/resourceHashesCache.bin and b/label/review-to-geojson/.gradle/9.3.1/fileHashes/resourceHashesCache.bin differ diff --git a/label/review-to-geojson/.gradle/buildOutputCleanup/buildOutputCleanup.lock b/label/review-to-geojson/.gradle/buildOutputCleanup/buildOutputCleanup.lock index 887eeac..98ed7bc 100644 Binary files a/label/review-to-geojson/.gradle/buildOutputCleanup/buildOutputCleanup.lock and b/label/review-to-geojson/.gradle/buildOutputCleanup/buildOutputCleanup.lock differ diff --git a/label/review-to-geojson/.gradle/file-system.probe b/label/review-to-geojson/.gradle/file-system.probe index aa54cc9..a6c301c 100644 Binary files a/label/review-to-geojson/.gradle/file-system.probe and b/label/review-to-geojson/.gradle/file-system.probe differ diff --git a/label/review-to-geojson/build/classes/java/main/com/kamcoback/cd/review/service/TrainingDataReviewJobService.class b/label/review-to-geojson/build/classes/java/main/com/kamcoback/cd/review/service/TrainingDataReviewJobService.class index b84852e..a854c1b 100644 Binary files a/label/review-to-geojson/build/classes/java/main/com/kamcoback/cd/review/service/TrainingDataReviewJobService.class and b/label/review-to-geojson/build/classes/java/main/com/kamcoback/cd/review/service/TrainingDataReviewJobService.class differ diff --git a/label/review-to-geojson/build/libs/TrainingDataReview-0.0.1-SNAPSHOT-plain.jar b/label/review-to-geojson/build/libs/TrainingDataReview-0.0.1-SNAPSHOT-plain.jar index 64b5fb6..3d2e9b4 100644 Binary files a/label/review-to-geojson/build/libs/TrainingDataReview-0.0.1-SNAPSHOT-plain.jar and b/label/review-to-geojson/build/libs/TrainingDataReview-0.0.1-SNAPSHOT-plain.jar differ diff --git a/label/review-to-geojson/build/libs/review-to-geojson.jar b/label/review-to-geojson/build/libs/review-to-geojson.jar index c734ee7..5c0570f 100644 Binary files a/label/review-to-geojson/build/libs/review-to-geojson.jar and b/label/review-to-geojson/build/libs/review-to-geojson.jar differ diff --git a/label/review-to-geojson/build/resources/main/application-prod.yml b/label/review-to-geojson/build/resources/main/application-prod.yml index 1d17099..471febd 100644 --- a/label/review-to-geojson/build/resources/main/application-prod.yml +++ b/label/review-to-geojson/build/resources/main/application-prod.yml @@ -84,28 +84,28 @@ mapsheet: baseurl: /app/detect/result #현재사용안함 file: - sync-root-dir: /data/images/ - sync-tmp-dir: /data/repo/tmp # image upload temp dir + sync-root-dir: /kamco-nfs/images/ + sync-tmp-dir: /kamco-nfs/repo/tmp # image upload temp dir sync-file-extention: tfw,tif - #dataset-dir: D:/data/model_output/ #변경 model_output - dataset-dir: /data/model_output/export/ # 마운트경로 AI 추론결과 + #dataset-dir: D:/kamco-nfs/model_output/ #변경 model_output + dataset-dir: /kamco-nfs/model_output/export/ # 마운트경로 AI 추론결과 dataset-tmp-dir: ${file.dataset-dir}tmp/ - #model-dir: D:/data/ckpt/model/ - model-dir: /data/ckpt/model/ # 학습서버에서 트레이닝한 모델업로드경로 + #model-dir: D:/kamco-nfs/ckpt/model/ + model-dir: /kamco-nfs/ckpt/model/ # 학습서버에서 트레이닝한 모델업로드경로 model-tmp-dir: ${file.model-dir}tmp/ model-file-extention: pth,json,py - pt-path: /data/ckpt/v6-cls-checkpoints/ + pt-path: /kamco-nfs/ckpt/v6-cls-checkpoints/ pt-FileName: yolov8_6th-6m.pt - dataset-response: /data/dataset/response/ + dataset-response: /kamco-nfs/dataset/response/ inference: url: http://127.0.0.1:8000/jobs batch-url: http://127.0.0.1:8000/batches - geojson-dir: /data/requests/ # 학습서버에서 트레이닝한 모델업로드경로 - jar-path: /data/repo/jar/shp-exporter.jar # 추론실행을 위한 파일생성경로 + geojson-dir: /kamco-nfs/requests/ # 학습서버에서 트레이닝한 모델업로드경로 + jar-path: /kamco-nfs/repo/jar/shp-exporter.jar # 추론실행을 위한 파일생성경로 inference-server-name: server1,server2,server3,server4 gukyuin: @@ -113,7 +113,7 @@ gukyuin: cdi: ${gukyuin.url}/api/kcd/cdi training-data: - geojson-dir: /data/dataset/request/ + geojson-dir: /kamco-nfs/dataset/request/ layer: geoserver-url: https://kamco.geo-dev.gs.dabeeo.com diff --git a/label/review-to-geojson/build/tmp/compileJava/previous-compilation-data.bin b/label/review-to-geojson/build/tmp/compileJava/previous-compilation-data.bin index cc6ceb8..04bbcb8 100644 Binary files a/label/review-to-geojson/build/tmp/compileJava/previous-compilation-data.bin and b/label/review-to-geojson/build/tmp/compileJava/previous-compilation-data.bin differ diff --git a/label/review-to-geojson/src/main/java/com/kamcoback/cd/review/service/TrainingDataReviewJobService.java b/label/review-to-geojson/src/main/java/com/kamcoback/cd/review/service/TrainingDataReviewJobService.java index 984f769..6d68156 100644 --- a/label/review-to-geojson/src/main/java/com/kamcoback/cd/review/service/TrainingDataReviewJobService.java +++ b/label/review-to-geojson/src/main/java/com/kamcoback/cd/review/service/TrainingDataReviewJobService.java @@ -18,7 +18,6 @@ import java.util.Objects; import lombok.RequiredArgsConstructor; import lombok.extern.log4j.Log4j2; import org.springframework.beans.factory.annotation.Value; -import org.springframework.scheduling.annotation.Scheduled; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -40,53 +39,69 @@ public class TrainingDataReviewJobService { return "local".equalsIgnoreCase(profile); } - @Scheduled(cron = "0 0 2 * * *") public void runTask() { exportGeojsonLabelingGeom(null); } @Transactional public void exportGeojsonLabelingGeom(LocalDate baseDate) { - // - // if (isLocalProfile()) { - // return; - // } // 1) 경로/파일명 결정 String targetDir = "local".equals(profile) ? System.getProperty("user.home") + "/geojson" : trainingDataDir; + log.info("[Step 1-1] geojson 파일 생성할 경로: {}", targetDir); // 2) 진행중인 회차 중, complete_cnt 가 존재하는 회차 목록 가져오기 + log.info("[Step 1-2] 진행중인 회차 중, complete_cnt 가 존재하는 회차 목록 가져오기"); List analList = trainingDataReviewJobCoreService.findAnalCntInfoList(); + log.info("[Step 1-3] 회차 리스트 건수: {}", analList == null ? 0 : analList.size()); + + if (analList.isEmpty()) { + log.info("[Step 1-4] 회차 리스트 없어 return 하고 종료"); + return; + } for (AnalCntInfo info : analList) { + log.info("[Step 2-1] 회차 폴리곤 전체 건수 == 파일 생성 건수 같은지 확인"); + log.info("=== info.getAllCnt(): {}", info.getAllCnt()); + log.info("=== info.getFileCnt(): {}", info.getFileCnt()); + if (Objects.equals(info.getAllCnt(), info.getFileCnt())) { + log.info("[Step 2-2] 회차 폴리곤 전체 건수 == 파일 생성 건수 같아서 파일 생성 진행하지 않음 continue"); continue; } String resultUid = info.getResultUid(); // 회차의 대문자 uid (폴더명으로 사용) // 3) 회차 + 어제까지 검수 완료된 총 데이터의 도엽별 목록 가져오기 + log.info("[Step 3-1] 회차 + 어제까지 검수 완료된 총 데이터의 도엽별 목록 가져오기"); List analMapList = trainingDataReviewJobCoreService.findCompletedAnalMapSheetList( info.getAnalUid(), baseDate); + log.info("=== analMapList cnt: {}", analMapList == null ? 0 : analMapList.size()); if (analMapList.isEmpty()) { + log.info("[Step 3-2] 도엽 목록 조회되지 않아 continue"); continue; } + log.info("[Step 4-1] 도엽별 geom 데이터 가지고 와서 geojson 만들기 시작"); for (AnalMapSheetList mapSheet : analMapList) { // 4) 도엽별 geom 데이터 가지고 와서 geojson 만들기 + log.info("[Step 4-2] 도엽별 검수완료된 폴리곤 데이터 목록 조회"); List completeList = trainingDataReviewJobCoreService.findCompletedYesterdayLabelingList( info.getAnalUid(), mapSheet.getMapSheetNum(), baseDate); + log.info("=== completeList size: {}", completeList == null ? 0 : completeList.size()); if (!completeList.isEmpty()) { + log.info("[Step 4-3] 목록에서 filter로 geoUid List 생성, 폴리곤 feature별 리스트 생성"); List geoUids = completeList.stream().map(CompleteLabelData::getGeoUid).toList(); List features = completeList.stream().map(GeoJsonFeature::from).toList(); // 5) 파일서버에 uid 폴더 생성 후 업로드 하기 + log.info("[Step 5-1] 파일서버에 uid 폴더 생성 후 업로드 하기 시작"); FeatureCollection collection = new FeatureCollection(features); String filename = String.format( @@ -96,15 +111,21 @@ public class TrainingDataReviewJobService { mapSheet.getTargetYyyy(), mapSheet.getMapSheetNum()); + log.info("=== filename: {}", filename); + log.info("=== 회차의 uid: {}", resultUid); Path outputPath = Paths.get(targetDir + "/" + resultUid, filename); + log.info("=== outputPath: {}", outputPath); try { + log.info("[Step 6-1] Uid로 폴더 생성"); Files.createDirectories(outputPath.getParent()); + log.info("[Step 6-2] geoJson 파일 생성"); ObjectMapper objectMapper = new ObjectMapper(); objectMapper.enable(SerializationFeature.INDENT_OUTPUT); objectMapper.writeValue(outputPath.toFile(), collection); // geoUids : file_create_yn = true 로 업데이트 + log.info("[Step 6-3] learn_data_geom 에 file_create_yn = true 로 업데이트"); trainingDataReviewJobCoreService.updateLearnDataGeomFileCreateYn(geoUids); } catch (IOException e) { diff --git a/label/review-to-geojson/src/main/resources/application-prod.yml b/label/review-to-geojson/src/main/resources/application-prod.yml index 1d17099..471febd 100644 --- a/label/review-to-geojson/src/main/resources/application-prod.yml +++ b/label/review-to-geojson/src/main/resources/application-prod.yml @@ -84,28 +84,28 @@ mapsheet: baseurl: /app/detect/result #현재사용안함 file: - sync-root-dir: /data/images/ - sync-tmp-dir: /data/repo/tmp # image upload temp dir + sync-root-dir: /kamco-nfs/images/ + sync-tmp-dir: /kamco-nfs/repo/tmp # image upload temp dir sync-file-extention: tfw,tif - #dataset-dir: D:/data/model_output/ #변경 model_output - dataset-dir: /data/model_output/export/ # 마운트경로 AI 추론결과 + #dataset-dir: D:/kamco-nfs/model_output/ #변경 model_output + dataset-dir: /kamco-nfs/model_output/export/ # 마운트경로 AI 추론결과 dataset-tmp-dir: ${file.dataset-dir}tmp/ - #model-dir: D:/data/ckpt/model/ - model-dir: /data/ckpt/model/ # 학습서버에서 트레이닝한 모델업로드경로 + #model-dir: D:/kamco-nfs/ckpt/model/ + model-dir: /kamco-nfs/ckpt/model/ # 학습서버에서 트레이닝한 모델업로드경로 model-tmp-dir: ${file.model-dir}tmp/ model-file-extention: pth,json,py - pt-path: /data/ckpt/v6-cls-checkpoints/ + pt-path: /kamco-nfs/ckpt/v6-cls-checkpoints/ pt-FileName: yolov8_6th-6m.pt - dataset-response: /data/dataset/response/ + dataset-response: /kamco-nfs/dataset/response/ inference: url: http://127.0.0.1:8000/jobs batch-url: http://127.0.0.1:8000/batches - geojson-dir: /data/requests/ # 학습서버에서 트레이닝한 모델업로드경로 - jar-path: /data/repo/jar/shp-exporter.jar # 추론실행을 위한 파일생성경로 + geojson-dir: /kamco-nfs/requests/ # 학습서버에서 트레이닝한 모델업로드경로 + jar-path: /kamco-nfs/repo/jar/shp-exporter.jar # 추론실행을 위한 파일생성경로 inference-server-name: server1,server2,server3,server4 gukyuin: @@ -113,7 +113,7 @@ gukyuin: cdi: ${gukyuin.url}/api/kcd/cdi training-data: - geojson-dir: /data/dataset/request/ + geojson-dir: /kamco-nfs/dataset/request/ layer: geoserver-url: https://kamco.geo-dev.gs.dabeeo.com