Compare commits
18 Commits
001ad73de7
...
feat/dean/
| Author | SHA1 | Date | |
|---|---|---|---|
| 32d56cf8fe | |||
| c3b7daebb7 | |||
| 2188d426d4 | |||
| 5c2ee0974b | |||
| 7980fe1d42 | |||
| c10141e915 | |||
| 97565c5369 | |||
| 30f0e1a885 | |||
| ba562261c3 | |||
| a084c80715 | |||
| a44e93c234 | |||
| a63b81008a | |||
| 2309357c0d | |||
| ee76389d6c | |||
| 7b15e5bb8c | |||
| 2508f59a72 | |||
| f2307ff0f4 | |||
| 6f44319d33 |
@@ -279,7 +279,9 @@ public class FIleChecker {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static List<Folder> getFolderAll(String dirPath, String sortType, int maxDepth) {
|
// kamco-nfs를 확인하는곳이 있어서 파라미터 추가 사용용도확인후 처리
|
||||||
|
public static List<Folder> getFolderAll(
|
||||||
|
String dirPath, String sortType, int maxDepth, String nfsRootDir) {
|
||||||
|
|
||||||
Path startPath = Paths.get(dirPath);
|
Path startPath = Paths.get(dirPath);
|
||||||
|
|
||||||
@@ -308,8 +310,12 @@ public class FIleChecker {
|
|||||||
String parentPath = path.getParent().toString();
|
String parentPath = path.getParent().toString();
|
||||||
String fullPath = path.toAbsolutePath().toString();
|
String fullPath = path.toAbsolutePath().toString();
|
||||||
|
|
||||||
|
// 이것이 필요한건가?
|
||||||
|
// boolean isShowHide =
|
||||||
|
// !parentFolderNm.equals("kamco-nfs"); // 폴더 리스트에
|
||||||
|
// kamco-nfs 하위만 나오도록 처리
|
||||||
boolean isShowHide =
|
boolean isShowHide =
|
||||||
!parentFolderNm.equals("kamco-nfs"); // 폴더 리스트에 kamco-nfs 하위만 나오도록 처리
|
!parentFolderNm.equals(nfsRootDir); // 폴더 리스트에 nfsRootDir 하위만 나오도록 처리
|
||||||
File file = new File(fullPath);
|
File file = new File(fullPath);
|
||||||
int childCnt = getChildFolderCount(file);
|
int childCnt = getChildFolderCount(file);
|
||||||
String lastModified = getLastModified(file);
|
String lastModified = getLastModified(file);
|
||||||
@@ -357,8 +363,8 @@ public class FIleChecker {
|
|||||||
return folderList;
|
return folderList;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static List<Folder> getFolderAll(String dirPath) {
|
public static List<Folder> getFolderAll(String dirPath, String nfsRootDir) {
|
||||||
return getFolderAll(dirPath, "name", 1);
|
return getFolderAll(dirPath, "name", 1, nfsRootDir);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static int getChildFolderCount(File directory) {
|
public static int getChildFolderCount(File directory) {
|
||||||
|
|||||||
@@ -0,0 +1,33 @@
|
|||||||
|
package com.kamco.cd.kamcoback.config;
|
||||||
|
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
|
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
@Component
|
||||||
|
@ConfigurationProperties(prefix = "file")
|
||||||
|
public class FileProperties {
|
||||||
|
|
||||||
|
private String root;
|
||||||
|
private String nfs;
|
||||||
|
private String syncRootDir;
|
||||||
|
private String syncTmpDir;
|
||||||
|
private String syncFileExtention;
|
||||||
|
private String datasetDir;
|
||||||
|
private String datasetTmpDir;
|
||||||
|
private String modelDir;
|
||||||
|
private String modelTmpDir;
|
||||||
|
private String modelFileExtention;
|
||||||
|
private String ptPath;
|
||||||
|
private String datasetResponse;
|
||||||
|
private TrainingData trainingData;
|
||||||
|
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
public static class TrainingData {
|
||||||
|
private String geojsonDir;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
package com.kamco.cd.kamcoback.config;
|
||||||
|
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
|
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
@Component
|
||||||
|
@ConfigurationProperties(prefix = "inference")
|
||||||
|
public class InferenceProperties {
|
||||||
|
|
||||||
|
private String nfs;
|
||||||
|
private String url;
|
||||||
|
private String batchUrl;
|
||||||
|
private String geojsonDir;
|
||||||
|
private String jarPath;
|
||||||
|
private String inferenceServerName;
|
||||||
|
}
|
||||||
@@ -105,7 +105,8 @@ public class SecurityConfig {
|
|||||||
"/api/layer/map/**",
|
"/api/layer/map/**",
|
||||||
"/api/layer/tile-url",
|
"/api/layer/tile-url",
|
||||||
"/api/layer/tile-url-year",
|
"/api/layer/tile-url-year",
|
||||||
"/api/common-code/clazz")
|
"/api/common-code/clazz",
|
||||||
|
"/api/inference/download/**")
|
||||||
.permitAll()
|
.permitAll()
|
||||||
// 로그인한 사용자만 가능 IAM
|
// 로그인한 사용자만 가능 IAM
|
||||||
.requestMatchers(
|
.requestMatchers(
|
||||||
|
|||||||
@@ -16,6 +16,8 @@ public class StartupLogger {
|
|||||||
|
|
||||||
private final Environment environment;
|
private final Environment environment;
|
||||||
private final DataSource dataSource;
|
private final DataSource dataSource;
|
||||||
|
private final FileProperties fileProperties;
|
||||||
|
private final InferenceProperties inferenceProperties;
|
||||||
|
|
||||||
@EventListener(ApplicationReadyEvent.class)
|
@EventListener(ApplicationReadyEvent.class)
|
||||||
public void logStartupInfo() {
|
public void logStartupInfo() {
|
||||||
@@ -79,6 +81,25 @@ public class StartupLogger {
|
|||||||
│ DDL Auto : %s
|
│ DDL Auto : %s
|
||||||
│ JDBC Batch Size : %s
|
│ JDBC Batch Size : %s
|
||||||
│ Fetch Batch Size : %s
|
│ Fetch Batch Size : %s
|
||||||
|
╠════════════════════════════════════════════════════════════════════════════════╣
|
||||||
|
║ FILE CONFIGURATION ║
|
||||||
|
╠────────────────────────────────────────────────────────────────────────────────╣
|
||||||
|
│ Root Directory : %s
|
||||||
|
│ NFS Mount Path : %s
|
||||||
|
│ Sync Root Dir : %s
|
||||||
|
│ Sync Tmp Dir : %s
|
||||||
|
│ Dataset Dir : %s
|
||||||
|
│ Model Dir : %s
|
||||||
|
│ PT Path : %s
|
||||||
|
╠════════════════════════════════════════════════════════════════════════════════╣
|
||||||
|
║ INFERENCE CONFIGURATION ║
|
||||||
|
╠────────────────────────────────────────────────────────────────────────────────╣
|
||||||
|
│ NFS Mount Path : %s
|
||||||
|
│ Inference URL : %s
|
||||||
|
│ Batch URL : %s
|
||||||
|
│ GeoJSON Dir : %s
|
||||||
|
│ JAR Path : %s
|
||||||
|
│ Server Names : %s
|
||||||
╚════════════════════════════════════════════════════════════════════════════════╝
|
╚════════════════════════════════════════════════════════════════════════════════╝
|
||||||
""",
|
""",
|
||||||
profileInfo,
|
profileInfo,
|
||||||
@@ -89,7 +110,24 @@ public class StartupLogger {
|
|||||||
showSql,
|
showSql,
|
||||||
ddlAuto,
|
ddlAuto,
|
||||||
batchSize,
|
batchSize,
|
||||||
batchFetchSize);
|
batchFetchSize,
|
||||||
|
fileProperties.getRoot() != null ? fileProperties.getRoot() : "N/A",
|
||||||
|
fileProperties.getNfs() != null ? fileProperties.getNfs() : "N/A",
|
||||||
|
fileProperties.getSyncRootDir() != null ? fileProperties.getSyncRootDir() : "N/A",
|
||||||
|
fileProperties.getSyncTmpDir() != null ? fileProperties.getSyncTmpDir() : "N/A",
|
||||||
|
fileProperties.getDatasetDir() != null ? fileProperties.getDatasetDir() : "N/A",
|
||||||
|
fileProperties.getModelDir() != null ? fileProperties.getModelDir() : "N/A",
|
||||||
|
fileProperties.getPtPath() != null ? fileProperties.getPtPath() : "N/A",
|
||||||
|
inferenceProperties.getNfs() != null ? inferenceProperties.getNfs() : "N/A",
|
||||||
|
inferenceProperties.getUrl() != null ? inferenceProperties.getUrl() : "N/A",
|
||||||
|
inferenceProperties.getBatchUrl() != null ? inferenceProperties.getBatchUrl() : "N/A",
|
||||||
|
inferenceProperties.getGeojsonDir() != null
|
||||||
|
? inferenceProperties.getGeojsonDir()
|
||||||
|
: "N/A",
|
||||||
|
inferenceProperties.getJarPath() != null ? inferenceProperties.getJarPath() : "N/A",
|
||||||
|
inferenceProperties.getInferenceServerName() != null
|
||||||
|
? inferenceProperties.getInferenceServerName()
|
||||||
|
: "N/A");
|
||||||
|
|
||||||
log.info(startupMessage);
|
log.info(startupMessage);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -83,7 +83,7 @@ public class ChngDetectMastDto {
|
|||||||
|
|
||||||
@Schema(
|
@Schema(
|
||||||
description = "탐지결과 절대경로명 /kamco_nas/export/{chnDtctId}",
|
description = "탐지결과 절대경로명 /kamco_nas/export/{chnDtctId}",
|
||||||
example = "/kamco-nfs/dataset/export/D5F192EC76D34F6592035BE63A84F591")
|
example = "{file.nfs}/dataset/export/D5F192EC76D34F6592035BE63A84F591")
|
||||||
private String pathNm;
|
private String pathNm;
|
||||||
|
|
||||||
@Schema(description = "사원번호", example = "123456")
|
@Schema(description = "사원번호", example = "123456")
|
||||||
|
|||||||
@@ -66,8 +66,11 @@ public class GukYuinApiService {
|
|||||||
@Value("${gukyuin.cdi}")
|
@Value("${gukyuin.cdi}")
|
||||||
private String gukyuinCdiUrl;
|
private String gukyuinCdiUrl;
|
||||||
|
|
||||||
@Value("${file.dataset-dir}")
|
@Value("${file.nfs}")
|
||||||
private String datasetDir;
|
private String nfs;
|
||||||
|
|
||||||
|
// @Value("${file.dataset-dir}")
|
||||||
|
// private String datasetDir;
|
||||||
|
|
||||||
@Transactional
|
@Transactional
|
||||||
public ChngDetectMastDto.RegistResDto regist(
|
public ChngDetectMastDto.RegistResDto regist(
|
||||||
@@ -453,7 +456,10 @@ public class GukYuinApiService {
|
|||||||
return new ResponseObj(ApiResponseCode.DUPLICATE_DATA, "이미 국유인 연동을 한 회차입니다.");
|
return new ResponseObj(ApiResponseCode.DUPLICATE_DATA, "이미 국유인 연동을 한 회차입니다.");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!Files.isDirectory(Path.of(datasetDir + info.getUid()))) {
|
// String kamconfsDatasetExportPathfsDatasetExportPath = "/kamco-nfs/dataset/export/";
|
||||||
|
String kamconfsDatasetExportPathfsDatasetExportPath =
|
||||||
|
String.format("%s%s", nfs, "/dataset/export/");
|
||||||
|
if (!Files.isDirectory(Path.of(kamconfsDatasetExportPathfsDatasetExportPath + info.getUid()))) {
|
||||||
return new ResponseObj(
|
return new ResponseObj(
|
||||||
ApiResponseCode.NOT_FOUND_DATA, "파일 경로에 회차 실행 파일이 생성되지 않았습니다. 확인 부탁드립니다.");
|
ApiResponseCode.NOT_FOUND_DATA, "파일 경로에 회차 실행 파일이 생성되지 않았습니다. 확인 부탁드립니다.");
|
||||||
}
|
}
|
||||||
@@ -468,7 +474,7 @@ public class GukYuinApiService {
|
|||||||
reqDto.setCrtrYr(String.valueOf(info.getTargetYyyy()));
|
reqDto.setCrtrYr(String.valueOf(info.getTargetYyyy()));
|
||||||
reqDto.setChnDtctSno(String.valueOf(maxStage + 1));
|
reqDto.setChnDtctSno(String.valueOf(maxStage + 1));
|
||||||
reqDto.setChnDtctId(info.getUid());
|
reqDto.setChnDtctId(info.getUid());
|
||||||
reqDto.setPathNm(datasetDir + info.getUid());
|
reqDto.setPathNm(kamconfsDatasetExportPathfsDatasetExportPath + info.getUid());
|
||||||
|
|
||||||
// 1회차를 종료 상태로 처리하고 2회차를 보내야 함
|
// 1회차를 종료 상태로 처리하고 2회차를 보내야 함
|
||||||
// 추론(learn), 학습데이터(inference) 둘 다 종료 처리
|
// 추론(learn), 학습데이터(inference) 둘 다 종료 처리
|
||||||
|
|||||||
@@ -246,15 +246,15 @@ public class InferenceResultDto {
|
|||||||
@NotBlank
|
@NotBlank
|
||||||
private String title;
|
private String title;
|
||||||
|
|
||||||
@Schema(description = "G1", example = "b40e0f68-c1d8-49fc-93f9-a36270093861")
|
@Schema(description = "G1", example = "643adead-f3d2-4f10-9037-862bee919399")
|
||||||
@NotNull
|
@NotNull
|
||||||
private UUID model1Uuid;
|
private UUID model1Uuid;
|
||||||
|
|
||||||
@Schema(description = "G2", example = "ec92b7d2-b5a3-4915-9bdf-35fb3ca8ad27")
|
@Schema(description = "G2", example = "dd86b4ef-28e3-4e3d-9ee4-f60d9cb54e13")
|
||||||
@NotNull
|
@NotNull
|
||||||
private UUID model2Uuid;
|
private UUID model2Uuid;
|
||||||
|
|
||||||
@Schema(description = "G3", example = "37f45782-8ccf-4cf6-911c-a055a1510d39")
|
@Schema(description = "G3", example = "58c1153e-dec6-4424-82a1-189083a9d9dc")
|
||||||
@NotNull
|
@NotNull
|
||||||
private UUID model3Uuid;
|
private UUID model3Uuid;
|
||||||
|
|
||||||
|
|||||||
@@ -5,8 +5,10 @@ import lombok.Getter;
|
|||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
import lombok.Setter;
|
import lombok.Setter;
|
||||||
import lombok.ToString;
|
import lombok.ToString;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
/** AI API 추론 실행 DTO */
|
/** AI API 추론 실행 DTO */
|
||||||
|
@Slf4j
|
||||||
@Getter
|
@Getter
|
||||||
@Setter
|
@Setter
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@@ -14,9 +16,6 @@ import lombok.ToString;
|
|||||||
@ToString
|
@ToString
|
||||||
public class InferenceSendDto {
|
public class InferenceSendDto {
|
||||||
|
|
||||||
private static final String DEV_PATH_PREFIX = "kamco-nfs";
|
|
||||||
private static final String PROD_PATH_PREFIX = "data";
|
|
||||||
|
|
||||||
private pred_requests_areas pred_requests_areas;
|
private pred_requests_areas pred_requests_areas;
|
||||||
private String model_version;
|
private String model_version;
|
||||||
private String cd_model_path;
|
private String cd_model_path;
|
||||||
@@ -26,19 +25,6 @@ public class InferenceSendDto {
|
|||||||
private String cd_model_type;
|
private String cd_model_type;
|
||||||
private Double priority;
|
private Double priority;
|
||||||
|
|
||||||
// 프로덕션은 경로가 바뀜
|
|
||||||
public void changeValForProd() {
|
|
||||||
if (pred_requests_areas != null) {
|
|
||||||
pred_requests_areas.changeValForProd();
|
|
||||||
}
|
|
||||||
if (this.cd_model_path != null) {
|
|
||||||
this.cd_model_path = this.cd_model_path.replace(DEV_PATH_PREFIX, PROD_PATH_PREFIX);
|
|
||||||
}
|
|
||||||
if (this.cls_model_path != null) {
|
|
||||||
this.cls_model_path = this.cls_model_path.replace(DEV_PATH_PREFIX, PROD_PATH_PREFIX);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Getter
|
@Getter
|
||||||
@Setter
|
@Setter
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
@@ -50,19 +36,5 @@ public class InferenceSendDto {
|
|||||||
private Integer input2_year;
|
private Integer input2_year;
|
||||||
private String input1_scene_path;
|
private String input1_scene_path;
|
||||||
private String input2_scene_path;
|
private String input2_scene_path;
|
||||||
|
|
||||||
public void changeValForProd() {
|
|
||||||
// ai팀에서 kamco-nfs를 data로 세팅했음
|
|
||||||
if (this.input1_scene_path != null) {
|
|
||||||
this.input1_scene_path =
|
|
||||||
this.input1_scene_path.replace(
|
|
||||||
InferenceSendDto.DEV_PATH_PREFIX, InferenceSendDto.PROD_PATH_PREFIX);
|
|
||||||
}
|
|
||||||
if (this.input2_scene_path != null) {
|
|
||||||
this.input2_scene_path =
|
|
||||||
this.input2_scene_path.replace(
|
|
||||||
InferenceSendDto.DEV_PATH_PREFIX, InferenceSendDto.PROD_PATH_PREFIX);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -47,14 +47,12 @@ import java.util.ArrayList;
|
|||||||
import java.util.Comparator;
|
import java.util.Comparator;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
import java.util.LinkedHashMap;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import java.util.function.Function;
|
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import lombok.extern.log4j.Log4j2;
|
import lombok.extern.log4j.Log4j2;
|
||||||
@@ -67,6 +65,7 @@ import org.springframework.http.MediaType;
|
|||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
/** 추론 관리 */
|
||||||
@Service
|
@Service
|
||||||
@Log4j2
|
@Log4j2
|
||||||
@RequiredArgsConstructor
|
@RequiredArgsConstructor
|
||||||
@@ -120,6 +119,12 @@ public class InferenceResultService {
|
|||||||
return dto.getUuid();
|
return dto.getUuid();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 추론 실행 - 추론제외, 이전년도 도엽 사용 분기
|
||||||
|
*
|
||||||
|
* @param req
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
@Transactional
|
@Transactional
|
||||||
public UUID run(InferenceResultDto.RegReq req) {
|
public UUID run(InferenceResultDto.RegReq req) {
|
||||||
if (req.getDetectOption().equals(DetectOption.EXCL.getId())) {
|
if (req.getDetectOption().equals(DetectOption.EXCL.getId())) {
|
||||||
@@ -199,7 +204,7 @@ public class InferenceResultService {
|
|||||||
// target 목록 조회
|
// target 목록 조회
|
||||||
List<MngListDto> targetDtoList = mapSheetMngCoreService.getHstMapSheetList(req);
|
List<MngListDto> targetDtoList = mapSheetMngCoreService.getHstMapSheetList(req);
|
||||||
|
|
||||||
// target 도엽번호 리스트 추출
|
// target 도엽번호 리스트 추출 중복 제거
|
||||||
List<String> targetList =
|
List<String> targetList =
|
||||||
targetDtoList.stream()
|
targetDtoList.stream()
|
||||||
.map(MngListDto::getMapSheetNum)
|
.map(MngListDto::getMapSheetNum)
|
||||||
@@ -207,9 +212,6 @@ public class InferenceResultService {
|
|||||||
.distinct()
|
.distinct()
|
||||||
.toList();
|
.toList();
|
||||||
|
|
||||||
// target 포함 여부 판단
|
|
||||||
Set<String> targetSet = new HashSet<>(targetList);
|
|
||||||
|
|
||||||
// compare 목록 조회
|
// compare 목록 조회
|
||||||
List<MapSheetFallbackYearDto> compareDtoList =
|
List<MapSheetFallbackYearDto> compareDtoList =
|
||||||
new ArrayList<>(mapSheetMngCoreService.getMapSheetNumDtoByHst(req.getCompareYyyy()));
|
new ArrayList<>(mapSheetMngCoreService.getMapSheetNumDtoByHst(req.getCompareYyyy()));
|
||||||
@@ -221,34 +223,21 @@ public class InferenceResultService {
|
|||||||
.filter(Objects::nonNull)
|
.filter(Objects::nonNull)
|
||||||
.collect(Collectors.toSet());
|
.collect(Collectors.toSet());
|
||||||
|
|
||||||
// arget에는 있으나 compare에는 없는 도엽 추출
|
// target에는 있으나 compare에는 없는 도엽 추출
|
||||||
List<String> remainingTargetList =
|
List<String> remainingTargetList =
|
||||||
targetList.stream().filter(s -> !compareSet.contains(s)).toList();
|
targetList.stream().filter(s -> !compareSet.contains(s)).toList();
|
||||||
|
|
||||||
// fallback년도 도엽 조회
|
// compare에 없을때 이전 년도 사용 가능여부 조회
|
||||||
List<MapSheetFallbackYearDto> fallbackYearDtoList =
|
List<MapSheetFallbackYearDto> fallbackYearDtoList =
|
||||||
mapSheetMngCoreService.findFallbackCompareYearByMapSheets(
|
mapSheetMngCoreService.findFallbackCompareYearByMapSheets(
|
||||||
req.getTargetYyyy(), // 대상년도 기준
|
req.getTargetYyyy(), // 대상년도 기준
|
||||||
remainingTargetList // compare에 없는 도엽들
|
remainingTargetList // compare에 없는 도엽들
|
||||||
);
|
);
|
||||||
|
|
||||||
// 기존 compare , fallback 합치기
|
// 기존 compare , 사용가능 이전년도 정보 합치기
|
||||||
compareDtoList.addAll(fallbackYearDtoList);
|
compareDtoList.addAll(fallbackYearDtoList);
|
||||||
|
|
||||||
// mapSheetNum 기준 중복 제거 (기존 compare 우선 유지)
|
// 중복제거하여 사용할 compare 도엽 목록
|
||||||
compareDtoList =
|
|
||||||
new ArrayList<>(
|
|
||||||
compareDtoList.stream()
|
|
||||||
.filter(d -> d.getMapSheetNum() != null)
|
|
||||||
.collect(
|
|
||||||
Collectors.toMap(
|
|
||||||
MapSheetFallbackYearDto::getMapSheetNum,
|
|
||||||
Function.identity(),
|
|
||||||
(existing, replacement) -> existing, // 기존 우선
|
|
||||||
LinkedHashMap::new))
|
|
||||||
.values());
|
|
||||||
|
|
||||||
// 최종 compare 도엽 Set 구성
|
|
||||||
Set<String> availableCompareSheets =
|
Set<String> availableCompareSheets =
|
||||||
compareDtoList.stream()
|
compareDtoList.stream()
|
||||||
.map(MapSheetFallbackYearDto::getMapSheetNum)
|
.map(MapSheetFallbackYearDto::getMapSheetNum)
|
||||||
@@ -256,35 +245,11 @@ public class InferenceResultService {
|
|||||||
.collect(Collectors.toSet());
|
.collect(Collectors.toSet());
|
||||||
|
|
||||||
// 최종 추론 대상 도엽
|
// 최종 추론 대상 도엽
|
||||||
// target 중 compare(fallback)에 존재하는 도엽만 추출
|
// target 기준으로 compare 에 존재하는 도엽만 추출
|
||||||
List<String> filteredTargetList =
|
List<String> filteredTargetList =
|
||||||
targetList.stream().filter(availableCompareSheets::contains).toList();
|
targetList.stream().filter(availableCompareSheets::contains).toList();
|
||||||
|
|
||||||
// compare only 계산 (target에는 없는 compare 도엽 수)
|
// compareDtoList도 최종 기준으로 필터
|
||||||
long compareOnlyCount =
|
|
||||||
compareDtoList.stream()
|
|
||||||
.map(MapSheetFallbackYearDto::getMapSheetNum)
|
|
||||||
.filter(s -> s != null && !targetSet.contains(s))
|
|
||||||
.count();
|
|
||||||
|
|
||||||
// 연도별 도엽 비교 로그 출력
|
|
||||||
log.info(
|
|
||||||
"""
|
|
||||||
===== MapSheet Year Comparison =====
|
|
||||||
target Total: {}
|
|
||||||
compare Total: {}
|
|
||||||
Intersection: {}
|
|
||||||
target Only (Excluded): {}
|
|
||||||
compare Only: {}
|
|
||||||
====================================
|
|
||||||
""",
|
|
||||||
targetList.size(), // target count
|
|
||||||
compareDtoList.size(), // compare count
|
|
||||||
filteredTargetList.size(), // target 기준으로 compare 비교하여 최종 추론할 도엽 count
|
|
||||||
targetList.size() - filteredTargetList.size(), // compare에 존재하지 않는 target 도엽 수
|
|
||||||
compareOnlyCount); // target 에 존재하지 않는 compare 도엽수
|
|
||||||
|
|
||||||
// compareDtoList도 최종 교집합 기준으로 필터
|
|
||||||
Set<String> filteredTargetSet = new HashSet<>(filteredTargetList);
|
Set<String> filteredTargetSet = new HashSet<>(filteredTargetList);
|
||||||
|
|
||||||
List<MapSheetFallbackYearDto> filteredCompareDtoList =
|
List<MapSheetFallbackYearDto> filteredCompareDtoList =
|
||||||
@@ -293,6 +258,30 @@ public class InferenceResultService {
|
|||||||
.filter(d -> filteredTargetSet.contains(d.getMapSheetNum()))
|
.filter(d -> filteredTargetSet.contains(d.getMapSheetNum()))
|
||||||
.toList();
|
.toList();
|
||||||
|
|
||||||
|
// compare only 계산 (target에는 없는 compare 도엽 수) log 용
|
||||||
|
long compareOnlyCount =
|
||||||
|
compareDtoList.stream()
|
||||||
|
.map(MapSheetFallbackYearDto::getMapSheetNum)
|
||||||
|
.filter(s -> s != null && !targetList.contains(s))
|
||||||
|
.count();
|
||||||
|
|
||||||
|
// 연도별 도엽 비교 로그 출력
|
||||||
|
log.info(
|
||||||
|
"""
|
||||||
|
===== MapSheet Year Comparison =====
|
||||||
|
target Total: {}
|
||||||
|
compare Total: {}
|
||||||
|
Intersection: {}
|
||||||
|
target Only (Excluded): {}
|
||||||
|
compare Only: {}
|
||||||
|
====================================
|
||||||
|
""",
|
||||||
|
targetList.size(), // target count
|
||||||
|
compareDtoList.size(), // compare count
|
||||||
|
filteredTargetList.size(), // target 기준으로 compare 비교하여 최종 추론할 도엽 count
|
||||||
|
targetList.size() - filteredTargetList.size(), // compare에 존재하지 않는 target 도엽 수
|
||||||
|
compareOnlyCount); // target 에 존재하지 않는 compare 도엽수
|
||||||
|
|
||||||
// compare 기준 geojson 생성 (년도 fallback 반영)
|
// compare 기준 geojson 생성 (년도 fallback 반영)
|
||||||
Scene compareScene =
|
Scene compareScene =
|
||||||
getSceneInference(
|
getSceneInference(
|
||||||
@@ -604,10 +593,11 @@ public class InferenceResultService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 추론 AI API 호출
|
* 추론 AI API 호출 batch id를 리턴
|
||||||
*
|
*
|
||||||
* @param dto
|
* @param dto
|
||||||
*/
|
*/
|
||||||
|
// 같은함수가 왜 두개지
|
||||||
private Long ensureAccepted(InferenceSendDto dto) {
|
private Long ensureAccepted(InferenceSendDto dto) {
|
||||||
|
|
||||||
if (dto == null) {
|
if (dto == null) {
|
||||||
@@ -615,6 +605,14 @@ public class InferenceResultService {
|
|||||||
throw new CustomApiException("BAD_REQUEST", HttpStatus.BAD_REQUEST);
|
throw new CustomApiException("BAD_REQUEST", HttpStatus.BAD_REQUEST);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// [중복]운영환경일때 경로수정 dean 260226
|
||||||
|
if (profile != null && profile.equals("prod")) {
|
||||||
|
log.info("========================================================");
|
||||||
|
log.info("[CHANGE INFERENCE] profile = {} Inforence req", profile);
|
||||||
|
log.info("========================================================");
|
||||||
|
log.info("");
|
||||||
|
}
|
||||||
|
|
||||||
// 1) 요청 로그
|
// 1) 요청 로그
|
||||||
try {
|
try {
|
||||||
log.debug("Inference request dto={}", objectMapper.writeValueAsString(dto));
|
log.debug("Inference request dto={}", objectMapper.writeValueAsString(dto));
|
||||||
@@ -623,19 +621,22 @@ public class InferenceResultService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 2) local 환경 임시 처리
|
// 2) local 환경 임시 처리
|
||||||
if ("local".equals(profile)) {
|
// if ("local".equals(profile)) {
|
||||||
if (dto.getPred_requests_areas() == null) {
|
// if (dto.getPred_requests_areas() == null) {
|
||||||
throw new IllegalStateException("pred_requests_areas is null");
|
// throw new IllegalStateException("pred_requests_areas is null");
|
||||||
}
|
// }
|
||||||
dto.getPred_requests_areas().setInput1_scene_path("/kamco-nfs/requests/2023_local.geojson");
|
//
|
||||||
dto.getPred_requests_areas().setInput2_scene_path("/kamco-nfs/requests/2024_local.geojson");
|
// dto.getPred_requests_areas().setInput1_scene_path("/kamco-nfs/requests/2023_local.geojson");
|
||||||
}
|
//
|
||||||
|
// dto.getPred_requests_areas().setInput2_scene_path("/kamco-nfs/requests/2024_local.geojson");
|
||||||
|
// }
|
||||||
|
|
||||||
// 3) HTTP 호출
|
// 3) HTTP 호출
|
||||||
HttpHeaders headers = new HttpHeaders();
|
HttpHeaders headers = new HttpHeaders();
|
||||||
headers.setContentType(MediaType.APPLICATION_JSON);
|
headers.setContentType(MediaType.APPLICATION_JSON);
|
||||||
headers.setAccept(List.of(MediaType.APPLICATION_JSON));
|
headers.setAccept(List.of(MediaType.APPLICATION_JSON));
|
||||||
|
|
||||||
|
// 추론 실행 API 호출
|
||||||
ExternalCallResult<String> result =
|
ExternalCallResult<String> result =
|
||||||
externalHttpClient.call(inferenceUrl, HttpMethod.POST, dto, headers, String.class);
|
externalHttpClient.call(inferenceUrl, HttpMethod.POST, dto, headers, String.class);
|
||||||
|
|
||||||
@@ -650,12 +651,14 @@ public class InferenceResultService {
|
|||||||
objectMapper.readValue(result.body(), new TypeReference<>() {});
|
objectMapper.readValue(result.body(), new TypeReference<>() {});
|
||||||
|
|
||||||
if (list.isEmpty()) {
|
if (list.isEmpty()) {
|
||||||
throw new IllegalStateException("Inference response is empty");
|
throw new CustomApiException(
|
||||||
|
"NOT_FOUND", HttpStatus.NOT_FOUND, "Inference response is empty");
|
||||||
}
|
}
|
||||||
|
|
||||||
Object batchIdObj = list.get(0).get("batch_id");
|
Object batchIdObj = list.get(0).get("batch_id");
|
||||||
if (batchIdObj == null) {
|
if (batchIdObj == null) {
|
||||||
throw new IllegalStateException("batch_id not found in response");
|
throw new CustomApiException(
|
||||||
|
"NOT_FOUND", HttpStatus.NOT_FOUND, "batch_id not found in response");
|
||||||
}
|
}
|
||||||
|
|
||||||
return Long.valueOf(batchIdObj.toString());
|
return Long.valueOf(batchIdObj.toString());
|
||||||
@@ -674,6 +677,7 @@ public class InferenceResultService {
|
|||||||
*/
|
*/
|
||||||
private InferenceSendDto getModelInfo(UUID uuid) {
|
private InferenceSendDto getModelInfo(UUID uuid) {
|
||||||
|
|
||||||
|
// 모델정보 조회
|
||||||
Basic modelInfo = modelMngCoreService.findByModelUuid(uuid);
|
Basic modelInfo = modelMngCoreService.findByModelUuid(uuid);
|
||||||
|
|
||||||
String cdModelPath = "";
|
String cdModelPath = "";
|
||||||
@@ -713,13 +717,6 @@ public class InferenceResultService {
|
|||||||
sendDto.setCls_model_version(modelInfo.getModelVer());
|
sendDto.setCls_model_version(modelInfo.getModelVer());
|
||||||
sendDto.setCd_model_type(modelType);
|
sendDto.setCd_model_type(modelType);
|
||||||
sendDto.setPriority(5d);
|
sendDto.setPriority(5d);
|
||||||
|
|
||||||
// 운영환경일때 경로수정 dean 260226
|
|
||||||
if (profile != null && profile.equals("prod")) {
|
|
||||||
log.info("profile = {} change inforence req", profile);
|
|
||||||
sendDto.changeValForProd();
|
|
||||||
}
|
|
||||||
|
|
||||||
log.info("[Inference Send]SendDto={}", sendDto);
|
log.info("[Inference Send]SendDto={}", sendDto);
|
||||||
return sendDto;
|
return sendDto;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -47,6 +47,9 @@ public class MapSheetMngService {
|
|||||||
private final UploadService uploadService;
|
private final UploadService uploadService;
|
||||||
private final UserUtil userUtil = new UserUtil();
|
private final UserUtil userUtil = new UserUtil();
|
||||||
|
|
||||||
|
@Value("${file.root}")
|
||||||
|
private String nfsRootDir;
|
||||||
|
|
||||||
@Value("${file.sync-root-dir}")
|
@Value("${file.sync-root-dir}")
|
||||||
private String syncRootDir;
|
private String syncRootDir;
|
||||||
|
|
||||||
@@ -111,7 +114,6 @@ public class MapSheetMngService {
|
|||||||
public DmlReturn uploadPair(
|
public DmlReturn uploadPair(
|
||||||
MultipartFile tfwFile, String tifFile, Long hstUid, Long tifFileSize) {
|
MultipartFile tfwFile, String tifFile, Long hstUid, Long tifFileSize) {
|
||||||
|
|
||||||
String rootPath = syncRootDir;
|
|
||||||
String tmpPath = syncTmpDir;
|
String tmpPath = syncTmpDir;
|
||||||
|
|
||||||
DmlReturn dmlReturn = new DmlReturn("success", "UPLOAD COMPLETE");
|
DmlReturn dmlReturn = new DmlReturn("success", "UPLOAD COMPLETE");
|
||||||
@@ -133,6 +135,7 @@ public class MapSheetMngService {
|
|||||||
return dmlReturn;
|
return dmlReturn;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO 삭제?
|
||||||
MngDto mngDto = mapSheetMngCoreService.findMapSheetMng(errDto.getMngYyyy());
|
MngDto mngDto = mapSheetMngCoreService.findMapSheetMng(errDto.getMngYyyy());
|
||||||
|
|
||||||
// 중복체크 -> 도엽50k/uuid 경로에 업로드 할 거라 overwrite 되지 않음
|
// 중복체크 -> 도엽50k/uuid 경로에 업로드 할 거라 overwrite 되지 않음
|
||||||
@@ -340,7 +343,7 @@ public class MapSheetMngService {
|
|||||||
|
|
||||||
log.info("[FIND_FOLDER] DIR : {}", dirPath);
|
log.info("[FIND_FOLDER] DIR : {}", dirPath);
|
||||||
List<FIleChecker.Folder> folderList =
|
List<FIleChecker.Folder> folderList =
|
||||||
FIleChecker.getFolderAll(dirPath).stream()
|
FIleChecker.getFolderAll(dirPath, nfsRootDir).stream()
|
||||||
.filter(dir -> dir.getIsValid().equals(true))
|
.filter(dir -> dir.getIsValid().equals(true))
|
||||||
.toList();
|
.toList();
|
||||||
|
|
||||||
|
|||||||
@@ -369,6 +369,12 @@ public class InferenceResultCoreService {
|
|||||||
return mapSheetLearnRepository.getInferenceServerStatusList();
|
return mapSheetLearnRepository.getInferenceServerStatusList();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 진행중 배치 조회
|
||||||
|
*
|
||||||
|
* @param status
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
public InferenceBatchSheet getInferenceResultByStatus(String status) {
|
public InferenceBatchSheet getInferenceResultByStatus(String status) {
|
||||||
MapSheetLearnEntity entity =
|
MapSheetLearnEntity entity =
|
||||||
mapSheetLearnRepository.getInferenceResultByStatus(status).orElse(null);
|
mapSheetLearnRepository.getInferenceResultByStatus(status).orElse(null);
|
||||||
@@ -403,6 +409,12 @@ public class InferenceResultCoreService {
|
|||||||
return mapSheetLearnRepository.getInferenceAiResultById(id, modelUuid);
|
return mapSheetLearnRepository.getInferenceAiResultById(id, modelUuid);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 추론 진행 현황 상세
|
||||||
|
*
|
||||||
|
* @param uuid
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
public InferenceStatusDetailDto getInferenceStatus(UUID uuid) {
|
public InferenceStatusDetailDto getInferenceStatus(UUID uuid) {
|
||||||
return mapSheetLearnRepository.getInferenceStatus(uuid);
|
return mapSheetLearnRepository.getInferenceStatus(uuid);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -367,6 +367,7 @@ public class MapSheetMngCoreService {
|
|||||||
return List.of();
|
return List.of();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 년도 별로 루프를 돌리기위해 년도별 정리
|
||||||
Map<Integer, List<MapSheetFallbackYearDto>> groupedByYear =
|
Map<Integer, List<MapSheetFallbackYearDto>> groupedByYear =
|
||||||
yearDtos.stream()
|
yearDtos.stream()
|
||||||
.filter(d -> d.getMngYyyy() != null && d.getMapSheetNum() != null)
|
.filter(d -> d.getMngYyyy() != null && d.getMapSheetNum() != null)
|
||||||
@@ -377,6 +378,7 @@ public class MapSheetMngCoreService {
|
|||||||
for (Map.Entry<Integer, List<MapSheetFallbackYearDto>> entry : groupedByYear.entrySet()) {
|
for (Map.Entry<Integer, List<MapSheetFallbackYearDto>> entry : groupedByYear.entrySet()) {
|
||||||
Integer year = entry.getKey();
|
Integer year = entry.getKey();
|
||||||
|
|
||||||
|
// 년도별 mapSheetNum 만들기
|
||||||
List<String> sheetNums =
|
List<String> sheetNums =
|
||||||
entry.getValue().stream()
|
entry.getValue().stream()
|
||||||
.map(MapSheetFallbackYearDto::getMapSheetNum)
|
.map(MapSheetFallbackYearDto::getMapSheetNum)
|
||||||
@@ -384,6 +386,7 @@ public class MapSheetMngCoreService {
|
|||||||
.distinct()
|
.distinct()
|
||||||
.toList();
|
.toList();
|
||||||
|
|
||||||
|
// tif파일 정보 조회
|
||||||
List<ImageFeature> temp = mapSheetMngRepository.getSceneInference(year.toString(), sheetNums);
|
List<ImageFeature> temp = mapSheetMngRepository.getSceneInference(year.toString(), sheetNums);
|
||||||
|
|
||||||
if (temp != null && !temp.isEmpty()) {
|
if (temp != null && !temp.isEmpty()) {
|
||||||
@@ -433,6 +436,12 @@ public class MapSheetMngCoreService {
|
|||||||
return entity.stream().map(MapSheetMngHstEntity::getMapSheetNum).toList();
|
return entity.stream().map(MapSheetMngHstEntity::getMapSheetNum).toList();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 특정 연도의 도엽 이력 데이터를 조회
|
||||||
|
*
|
||||||
|
* @param year
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
public List<MapSheetFallbackYearDto> getMapSheetNumDtoByHst(Integer year) {
|
public List<MapSheetFallbackYearDto> getMapSheetNumDtoByHst(Integer year) {
|
||||||
List<MapSheetMngHstEntity> entity = mapSheetMngRepository.getMapSheetMngHst(year);
|
List<MapSheetMngHstEntity> entity = mapSheetMngRepository.getMapSheetMngHst(year);
|
||||||
return entity.stream()
|
return entity.stream()
|
||||||
|
|||||||
@@ -18,29 +18,99 @@ import org.springframework.data.domain.Page;
|
|||||||
|
|
||||||
public interface MapSheetLearnRepositoryCustom {
|
public interface MapSheetLearnRepositoryCustom {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 추론 관리 목록 조회
|
||||||
|
*
|
||||||
|
* @param req 추론관리 목록 화면 조회 조건
|
||||||
|
* @return 추론 관리 목록
|
||||||
|
*/
|
||||||
Page<MapSheetLearnEntity> getInferenceMgnResultList(InferenceResultDto.SearchListReq req);
|
Page<MapSheetLearnEntity> getInferenceMgnResultList(InferenceResultDto.SearchListReq req);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* uuid 조건으로 추론 실행 정보 조회
|
||||||
|
*
|
||||||
|
* @param uuid uuid
|
||||||
|
* @return 추론 실행 정보
|
||||||
|
*/
|
||||||
Optional<MapSheetLearnEntity> getInferenceResultByUuid(UUID uuid);
|
Optional<MapSheetLearnEntity> getInferenceResultByUuid(UUID uuid);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 추론 실행중 서버정보 조회 cpu, gpu
|
||||||
|
*
|
||||||
|
* @return cpu, gpu 정보
|
||||||
|
*/
|
||||||
List<InferenceServerStatusDto> getInferenceServerStatusList();
|
List<InferenceServerStatusDto> getInferenceServerStatusList();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 추론 실행 목록 진행 상태별 조회
|
||||||
|
*
|
||||||
|
* @param status 추론 진행 상태
|
||||||
|
* @return 추론 실행 정보
|
||||||
|
*/
|
||||||
Optional<MapSheetLearnEntity> getInferenceResultByStatus(String status);
|
Optional<MapSheetLearnEntity> getInferenceResultByStatus(String status);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 등록된 추론 실행목록 및 등록된 모델 정보 조회
|
||||||
|
*
|
||||||
|
* @param id 추론 실행 테이블 id
|
||||||
|
* @param modelUuid 모델 uuid
|
||||||
|
* @return 모델 정보
|
||||||
|
*/
|
||||||
InferenceProgressDto getInferenceAiResultById(Long id, UUID modelUuid);
|
InferenceProgressDto getInferenceAiResultById(Long id, UUID modelUuid);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 진행중인 추론 정보 상세 조회
|
||||||
|
*
|
||||||
|
* @param uuid 추론진행 uuid
|
||||||
|
* @return 진행중인 추론정보 상세 정보
|
||||||
|
*/
|
||||||
InferenceStatusDetailDto getInferenceStatus(UUID uuid);
|
InferenceStatusDetailDto getInferenceStatus(UUID uuid);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 진행중인 추론이 있는지 조회
|
||||||
|
*
|
||||||
|
* @return 진행중인 추론 정보
|
||||||
|
*/
|
||||||
MapSheetLearnEntity getProcessing();
|
MapSheetLearnEntity getProcessing();
|
||||||
|
|
||||||
Integer getLearnStage(Integer compareYear, Integer targetYear);
|
/**
|
||||||
|
* 추론 결과 정보 조회
|
||||||
|
*
|
||||||
|
* @param uuid 추론 uuid
|
||||||
|
* @return 추론 결과 및 사용 모델 정보
|
||||||
|
*/
|
||||||
AnalResultInfo getInferenceResultInfo(UUID uuid);
|
AnalResultInfo getInferenceResultInfo(UUID uuid);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 추론 결과 bbox, point 조회
|
||||||
|
*
|
||||||
|
* @param uuid 추론 uuid
|
||||||
|
* @return bbox, pont 정보
|
||||||
|
*/
|
||||||
BboxPointDto getBboxPoint(UUID uuid);
|
BboxPointDto getBboxPoint(UUID uuid);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 분류별 탐지건수 조회
|
||||||
|
*
|
||||||
|
* @param uuid 추론 uuid
|
||||||
|
* @return 분류별 탐지건수 정보
|
||||||
|
*/
|
||||||
List<Dashboard> getInferenceClassCountList(UUID uuid);
|
List<Dashboard> getInferenceClassCountList(UUID uuid);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 추론 결과 상세 geom 목록 조회
|
||||||
|
*
|
||||||
|
* @param uuid 추론 uuid
|
||||||
|
* @param searchGeoReq 추론 결과 상세화면 geom 조회 조건
|
||||||
|
* @return geom 목록 정보
|
||||||
|
*/
|
||||||
Page<Geom> getInferenceGeomList(UUID uuid, SearchGeoReq searchGeoReq);
|
Page<Geom> getInferenceGeomList(UUID uuid, SearchGeoReq searchGeoReq);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 국유in연동 가능여부 확인 조회
|
||||||
|
*
|
||||||
|
* @param uuid 추론 uuid
|
||||||
|
* @return 추론 존재여부, 부분도엽 여부, 추론 진행중 여부, 국유인 작업 진행중 여부
|
||||||
|
*/
|
||||||
GukYuinLinkFacts findLinkFacts(UUID uuid);
|
GukYuinLinkFacts findLinkFacts(UUID uuid);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -291,24 +291,6 @@ public class MapSheetLearnRepositoryImpl implements MapSheetLearnRepositoryCusto
|
|||||||
.fetchOne();
|
.fetchOne();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public Integer getLearnStage(Integer compareYear, Integer targetYear) {
|
|
||||||
Integer stage =
|
|
||||||
queryFactory
|
|
||||||
.select(mapSheetLearnEntity.stage)
|
|
||||||
.from(mapSheetLearnEntity)
|
|
||||||
.where(
|
|
||||||
mapSheetLearnEntity
|
|
||||||
.compareYyyy
|
|
||||||
.eq(compareYear)
|
|
||||||
.and(mapSheetLearnEntity.targetYyyy.eq(targetYear)))
|
|
||||||
.orderBy(mapSheetLearnEntity.id.desc())
|
|
||||||
.limit(1)
|
|
||||||
.fetchOne();
|
|
||||||
|
|
||||||
return stage == null ? 1 : stage + 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public AnalResultInfo getInferenceResultInfo(UUID uuid) {
|
public AnalResultInfo getInferenceResultInfo(UUID uuid) {
|
||||||
QModelMngEntity m1 = new QModelMngEntity("m1");
|
QModelMngEntity m1 = new QModelMngEntity("m1");
|
||||||
@@ -528,6 +510,7 @@ public class MapSheetLearnRepositoryImpl implements MapSheetLearnRepositoryCusto
|
|||||||
@Override
|
@Override
|
||||||
public GukYuinLinkFacts findLinkFacts(UUID uuid) {
|
public GukYuinLinkFacts findLinkFacts(UUID uuid) {
|
||||||
|
|
||||||
|
// 해당 추론 있는지 확인
|
||||||
MapSheetLearnEntity learn =
|
MapSheetLearnEntity learn =
|
||||||
queryFactory
|
queryFactory
|
||||||
.selectFrom(QMapSheetLearnEntity.mapSheetLearnEntity)
|
.selectFrom(QMapSheetLearnEntity.mapSheetLearnEntity)
|
||||||
@@ -538,12 +521,14 @@ public class MapSheetLearnRepositoryImpl implements MapSheetLearnRepositoryCusto
|
|||||||
return new GukYuinLinkFacts(false, false, false, false);
|
return new GukYuinLinkFacts(false, false, false, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 부분 도엽 실행인지 확인
|
||||||
boolean isPartScope = MapSheetScope.PART.getId().equals(learn.getMapSheetScope());
|
boolean isPartScope = MapSheetScope.PART.getId().equals(learn.getMapSheetScope());
|
||||||
|
|
||||||
QMapSheetAnalInferenceEntity inf = QMapSheetAnalInferenceEntity.mapSheetAnalInferenceEntity;
|
QMapSheetAnalInferenceEntity inf = QMapSheetAnalInferenceEntity.mapSheetAnalInferenceEntity;
|
||||||
QMapSheetLearnEntity learn2 = new QMapSheetLearnEntity("learn2");
|
QMapSheetLearnEntity learn2 = new QMapSheetLearnEntity("learn2");
|
||||||
QMapSheetLearnEntity learnQ = QMapSheetLearnEntity.mapSheetLearnEntity;
|
QMapSheetLearnEntity learnQ = QMapSheetLearnEntity.mapSheetLearnEntity;
|
||||||
|
|
||||||
|
// 실행중인 추론 있는지 확인
|
||||||
boolean hasRunningInference =
|
boolean hasRunningInference =
|
||||||
queryFactory
|
queryFactory
|
||||||
.selectOne()
|
.selectOne()
|
||||||
@@ -557,6 +542,7 @@ public class MapSheetLearnRepositoryImpl implements MapSheetLearnRepositoryCusto
|
|||||||
.fetchFirst()
|
.fetchFirst()
|
||||||
!= null;
|
!= null;
|
||||||
|
|
||||||
|
// 국유인 작업 진행중 있는지 확인
|
||||||
boolean hasOtherUnfinishedGukYuin =
|
boolean hasOtherUnfinishedGukYuin =
|
||||||
queryFactory
|
queryFactory
|
||||||
.selectOne()
|
.selectOne()
|
||||||
|
|||||||
@@ -64,6 +64,12 @@ public interface MapSheetMngRepositoryCustom {
|
|||||||
|
|
||||||
List<MapSheetMngDto.MngFilesDto> findByHstUidMapSheetFileList(Long hstUid);
|
List<MapSheetMngDto.MngFilesDto> findByHstUidMapSheetFileList(Long hstUid);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 변화탐지 실행 가능 기준 연도 조회
|
||||||
|
*
|
||||||
|
* @param req 조회 연도, 도엽번호 목록,
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
List<MngListDto> findByHstMapSheetTargetList(InferenceResultDto.RegReq req);
|
List<MngListDto> findByHstMapSheetTargetList(InferenceResultDto.RegReq req);
|
||||||
|
|
||||||
List<MngListDto> findByHstMapSheetTargetList(int mngYyyy, List<String> mapIds);
|
List<MngListDto> findByHstMapSheetTargetList(int mngYyyy, List<String> mapIds);
|
||||||
|
|||||||
@@ -355,12 +355,7 @@ public class MapSheetInferenceJobService {
|
|||||||
m.setCls_model_version(progressDto.getClsModelVersion());
|
m.setCls_model_version(progressDto.getClsModelVersion());
|
||||||
m.setCd_model_type(type);
|
m.setCd_model_type(type);
|
||||||
m.setPriority(5d);
|
m.setPriority(5d);
|
||||||
// 운영환경일때 경로수정 dean 260226
|
log.info("[BEFORE INFERENCE] BEFORE SendDto={}", m);
|
||||||
if (profile != null && profile.equals("prod")) {
|
|
||||||
log.info("profile = {} [M]change inforence req", profile);
|
|
||||||
m.changeValForProd();
|
|
||||||
}
|
|
||||||
log.info("[Inference]SendDto={}", m);
|
|
||||||
// 추론 실행 api 호출
|
// 추론 실행 api 호출
|
||||||
Long batchId = ensureAccepted(m);
|
Long batchId = ensureAccepted(m);
|
||||||
|
|
||||||
@@ -380,6 +375,7 @@ public class MapSheetInferenceJobService {
|
|||||||
* @param dto
|
* @param dto
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
|
// 같은함수가 왜 두개지
|
||||||
private Long ensureAccepted(InferenceSendDto dto) {
|
private Long ensureAccepted(InferenceSendDto dto) {
|
||||||
if (dto == null) {
|
if (dto == null) {
|
||||||
log.warn("not InferenceSendDto dto");
|
log.warn("not InferenceSendDto dto");
|
||||||
@@ -387,22 +383,28 @@ public class MapSheetInferenceJobService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 1) 요청 로그
|
// 1) 요청 로그
|
||||||
log.info("Inference request dto={}", dto);
|
log.info("");
|
||||||
|
log.info("========================================================");
|
||||||
|
log.info("[SEND INFERENCE] Inference request dto= {}", dto);
|
||||||
|
log.info("========================================================");
|
||||||
|
log.info("");
|
||||||
// 2) local 환경 임시 처리
|
// 2) local 환경 임시 처리
|
||||||
if ("local".equals(profile)) {
|
// if ("local".equals(profile)) {
|
||||||
if (dto.getPred_requests_areas() == null) {
|
// if (dto.getPred_requests_areas() == null) {
|
||||||
throw new IllegalStateException("pred_requests_areas is null");
|
// throw new IllegalStateException("pred_requests_areas is null");
|
||||||
}
|
// }
|
||||||
dto.getPred_requests_areas().setInput1_scene_path("/kamco-nfs/requests/2023_local.geojson");
|
//
|
||||||
dto.getPred_requests_areas().setInput2_scene_path("/kamco-nfs/requests/2024_local.geojson");
|
// dto.getPred_requests_areas().setInput1_scene_path("/kamco-nfs/requests/2023_local.geojson");
|
||||||
}
|
//
|
||||||
|
// dto.getPred_requests_areas().setInput2_scene_path("/kamco-nfs/requests/2024_local.geojson");
|
||||||
|
// }
|
||||||
|
|
||||||
// 3) HTTP 호출
|
// 3) HTTP 호출
|
||||||
HttpHeaders headers = new HttpHeaders();
|
HttpHeaders headers = new HttpHeaders();
|
||||||
headers.setContentType(MediaType.APPLICATION_JSON);
|
headers.setContentType(MediaType.APPLICATION_JSON);
|
||||||
headers.setAccept(List.of(MediaType.APPLICATION_JSON));
|
headers.setAccept(List.of(MediaType.APPLICATION_JSON));
|
||||||
|
|
||||||
|
// TODO 어떤 URL로 어떤파리티러로 요청한 로딩해야지
|
||||||
ExternalCallResult<String> result =
|
ExternalCallResult<String> result =
|
||||||
externalHttpClient.call(inferenceUrl, HttpMethod.POST, dto, headers, String.class);
|
externalHttpClient.call(inferenceUrl, HttpMethod.POST, dto, headers, String.class);
|
||||||
|
|
||||||
@@ -417,6 +419,7 @@ public class MapSheetInferenceJobService {
|
|||||||
objectMapper.readValue(result.body(), new TypeReference<>() {});
|
objectMapper.readValue(result.body(), new TypeReference<>() {});
|
||||||
|
|
||||||
if (list.isEmpty()) {
|
if (list.isEmpty()) {
|
||||||
|
// 어떤 URL로 어떤파리티러로 요청한 정보를 봐야 재현을 할듯하지요
|
||||||
throw new IllegalStateException("Inference response is empty");
|
throw new IllegalStateException("Inference response is empty");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ public class TrainingDataReviewJobService {
|
|||||||
@Value("${spring.profiles.active}")
|
@Value("${spring.profiles.active}")
|
||||||
private String profile;
|
private String profile;
|
||||||
|
|
||||||
@Value("${training-data.geojson-dir}")
|
@Value("${file.training-data.geojson-dir}")
|
||||||
private String trainingDataDir;
|
private String trainingDataDir;
|
||||||
|
|
||||||
private boolean isLocalProfile() {
|
private boolean isLocalProfile() {
|
||||||
|
|||||||
@@ -89,36 +89,17 @@ mapsheet:
|
|||||||
shp:
|
shp:
|
||||||
baseurl: /app/tmp/detect/result #현재사용안함
|
baseurl: /app/tmp/detect/result #현재사용안함
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
file:
|
file:
|
||||||
#sync-root-dir: D:/kamco-nfs/images/
|
root: kamco-nfs
|
||||||
sync-root-dir: /kamco-nfs/images/
|
nfs: /kamco-nfs
|
||||||
sync-tmp-dir: /kamco-nfs/requests/temp # image upload temp dir
|
pt-path: ${file.nfs}/ckpt/model/v6-cls-checkpoints/
|
||||||
#sync-tmp-dir: ${file.sync-root-dir}/tmp
|
|
||||||
sync-file-extention: tfw,tif
|
|
||||||
# sync-auto-exception-start-year: 2024
|
|
||||||
# sync-auto-exception-before-year-cnt: 3
|
|
||||||
|
|
||||||
#dataset-dir: D:/kamco-nfs/model_output/
|
|
||||||
dataset-dir: /kamco-nfs/model_output/export/ # 마운트경로 AI 추론결과
|
|
||||||
dataset-tmp-dir: ${file.dataset-dir}tmp/
|
|
||||||
|
|
||||||
#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: /kamco-nfs/ckpt/model/v6-cls-checkpoints/
|
|
||||||
pt-FileName: yolov8_6th-6m.pt
|
pt-FileName: yolov8_6th-6m.pt
|
||||||
|
|
||||||
dataset-response: /kamco-nfs/dataset/response/
|
|
||||||
|
|
||||||
inference:
|
inference:
|
||||||
|
nfs: /kamco-nfs
|
||||||
url: http://192.168.2.183:8000/jobs
|
url: http://192.168.2.183:8000/jobs
|
||||||
batch-url: http://192.168.2.183:8000/batches
|
batch-url: http://192.168.2.183:8000/batches
|
||||||
geojson-dir: /kamco-nfs/requests/ # 추론실행을 위한 파일생성경로
|
jar-path: ${inference.nfs}/repo/jar/shp-exporter.jar
|
||||||
jar-path: /kamco-nfs/repo/jar/shp-exporter.jar
|
|
||||||
inference-server-name: server1,server2,server3,server4
|
inference-server-name: server1,server2,server3,server4
|
||||||
|
|
||||||
gukyuin:
|
gukyuin:
|
||||||
@@ -126,9 +107,6 @@ gukyuin:
|
|||||||
url: http://192.168.2.129:5301
|
url: http://192.168.2.129:5301
|
||||||
cdi: ${gukyuin.url}/api/kcd/cdi
|
cdi: ${gukyuin.url}/api/kcd/cdi
|
||||||
|
|
||||||
training-data:
|
|
||||||
geojson-dir: /kamco-nfs/dataset/request/
|
|
||||||
|
|
||||||
layer:
|
layer:
|
||||||
geoserver-url: https://kamco.geo-dev.gs.dabeeo.com
|
geoserver-url: https://kamco.geo-dev.gs.dabeeo.com
|
||||||
wms-path: geoserver/cd
|
wms-path: geoserver/cd
|
||||||
|
|||||||
@@ -67,34 +67,17 @@ mapsheet:
|
|||||||
shp:
|
shp:
|
||||||
baseurl: /Users/bokmin/detect/result
|
baseurl: /Users/bokmin/detect/result
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
file:
|
file:
|
||||||
sync-root-dir: C:/Users/gypark/kamco-nfs/images/
|
root: kamco-nfs
|
||||||
#sync-root-dir: /kamco-nfs/images/
|
nfs: C:/Users/gypark/kamco-nfs
|
||||||
sync-tmp-dir: ${file.sync-root-dir}/tmp/
|
pt-path: ${file.nfs}/ckpt/classification/
|
||||||
sync-file-extention: tfw,tif
|
|
||||||
# sync-auto-exception-start-year: 2025
|
|
||||||
# sync-auto-exception-before-year-cnt: 3
|
|
||||||
|
|
||||||
dataset-dir: C:/Users/gypark/kamco-nfs/dataset/
|
|
||||||
#dataset-dir: /kamco-nfs/dataset/export/
|
|
||||||
dataset-tmp-dir: ${file.dataset-dir}tmp/
|
|
||||||
|
|
||||||
model-dir: C:/Users/gypark/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: /kamco-nfs/ckpt/classification/
|
|
||||||
pt-FileName: v5-best.pt
|
pt-FileName: v5-best.pt
|
||||||
dataset-response: /kamco-nfs/dataset/response/
|
|
||||||
|
|
||||||
inference:
|
inference:
|
||||||
|
nfs: C:/Users/gyparkkamco-nfs
|
||||||
url: http://10.100.0.11:8000/jobs
|
url: http://10.100.0.11:8000/jobs
|
||||||
batch-url: http://10.100.0.11:8000/batches
|
batch-url: http://10.100.0.11:8000/batches
|
||||||
geojson-dir: /kamco-nfs/requests/
|
jar-path: jar/shp-exporter.jar
|
||||||
jar-path: jar/makeshp-1.0.0.jar
|
|
||||||
inference-server-name: server1,server2,server3,server4
|
inference-server-name: server1,server2,server3,server4
|
||||||
|
|
||||||
gukyuin:
|
gukyuin:
|
||||||
@@ -102,9 +85,6 @@ gukyuin:
|
|||||||
url: http://192.168.2.129:5301
|
url: http://192.168.2.129:5301
|
||||||
cdi: ${gukyuin.url}/api/kcd/cdi
|
cdi: ${gukyuin.url}/api/kcd/cdi
|
||||||
|
|
||||||
training-data:
|
|
||||||
geojson-dir: /kamco-nfs/model_output/labeling/
|
|
||||||
|
|
||||||
layer:
|
layer:
|
||||||
geoserver-url: https://kamco.geo-dev.gs.dabeeo.com
|
geoserver-url: https://kamco.geo-dev.gs.dabeeo.com
|
||||||
wms-path: geoserver/cd
|
wms-path: geoserver/cd
|
||||||
|
|||||||
@@ -84,36 +84,23 @@ mapsheet:
|
|||||||
baseurl: /app/detect/result #현재사용안함
|
baseurl: /app/detect/result #현재사용안함
|
||||||
|
|
||||||
file:
|
file:
|
||||||
sync-root-dir: /kamco-nfs/images/
|
root: data
|
||||||
sync-tmp-dir: /kamco-nfs/repo/tmp # image upload temp dir
|
nfs: /data
|
||||||
sync-file-extention: tfw,tif
|
pt-path: ${file.nfs}/ckpt/model/v6-cls-checkpoints/
|
||||||
|
|
||||||
#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:/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: /kamco-nfs/ckpt/v6-cls-checkpoints/
|
|
||||||
pt-FileName: yolov8_6th-6m.pt
|
pt-FileName: yolov8_6th-6m.pt
|
||||||
dataset-response: /kamco-nfs/dataset/response/
|
|
||||||
|
|
||||||
inference:
|
inference:
|
||||||
url: http://127.0.0.1:8000/jobs
|
nfs: /data
|
||||||
batch-url: http://127.0.0.1:8000/batches
|
url: http://172.16.4.56:8000/jobs
|
||||||
geojson-dir: /kamco-nfs/requests/ # 학습서버에서 트레이닝한 모델업로드경로
|
batch-url: http://172.16.4.56:8000/batches
|
||||||
jar-path: /kamco-nfs/repo/jar/shp-exporter.jar # 추론실행을 위한 파일생성경로
|
jar-path: ${inference.nfs}/repo/jar/shp-exporter.jar
|
||||||
inference-server-name: server1,server2,server3,server4
|
inference-server-name: server1,server2,server3,server4
|
||||||
|
|
||||||
gukyuin:
|
gukyuin:
|
||||||
url: http://127.0.0.1:5301
|
url: http://127.0.0.1:5301
|
||||||
cdi: ${gukyuin.url}/api/kcd/cdi
|
cdi: ${gukyuin.url}/api/kcd/cdi
|
||||||
|
|
||||||
training-data:
|
|
||||||
geojson-dir: /kamco-nfs/dataset/request/
|
|
||||||
|
|
||||||
layer:
|
layer:
|
||||||
geoserver-url: https://kamco.geo-dev.gs.dabeeo.com
|
geoserver-url: https://kamco.geo-dev.gs.dabeeo.com
|
||||||
|
|||||||
@@ -67,3 +67,22 @@ management:
|
|||||||
include:
|
include:
|
||||||
- "health"
|
- "health"
|
||||||
|
|
||||||
|
file:
|
||||||
|
root: kamco-nfs
|
||||||
|
nfs: /kamco-nfs
|
||||||
|
sync-root-dir: ${file.nfs}/images/
|
||||||
|
sync-tmp-dir: ${file.nfs}/requests/temp # image upload temp dir
|
||||||
|
sync-file-extention: tfw,tif
|
||||||
|
dataset-dir: ${file.nfs}/model_output/export/ # 마운트경로 AI 추론결과
|
||||||
|
dataset-tmp-dir: ${file.dataset-dir}tmp/
|
||||||
|
model-dir: ${file.nfs}/ckpt/model/ # 학습서버에서 트레이닝한 모델업로드경로
|
||||||
|
model-tmp-dir: ${file.model-dir}tmp/
|
||||||
|
model-file-extention: pth,json,py
|
||||||
|
pt-path: ${file.nfs}/ckpt/model/v6-cls-checkpoints/
|
||||||
|
dataset-response: ${file.nfs}/dataset/response/
|
||||||
|
training-data:
|
||||||
|
geojson-dir: ${file.nfs}/dataset/request/
|
||||||
|
inference:
|
||||||
|
nfs: /kamco-nfs
|
||||||
|
geojson-dir: ${inference.nfs}/requests/ # 추론실행을 위한 파일생성경로
|
||||||
|
jar-path: ${inference.nfs}/repo/jar/shp-exporter.jar
|
||||||
|
|||||||
Reference in New Issue
Block a user