Merge pull request 'feat/infer_dev_260107' (#188) from feat/infer_dev_260107 into develop
Reviewed-on: https://kamco.gitea.gs.dabeeo.com/dabeeo/kamco-dabeeo-backoffice/pulls/188
This commit is contained in:
@@ -23,6 +23,7 @@ public class InferenceSendDto {
|
|||||||
@Getter
|
@Getter
|
||||||
@Setter
|
@Setter
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
public static class PredRequestsAreas {
|
public static class PredRequestsAreas {
|
||||||
|
|
||||||
private Integer input1_year;
|
private Integer input1_year;
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ import com.kamco.cd.kamcoback.inference.dto.InferenceResultDto.MapSheetNumDto;
|
|||||||
import com.kamco.cd.kamcoback.inference.dto.InferenceResultDto.MapSheetScope;
|
import com.kamco.cd.kamcoback.inference.dto.InferenceResultDto.MapSheetScope;
|
||||||
import com.kamco.cd.kamcoback.inference.dto.InferenceResultDto.ResultList;
|
import com.kamco.cd.kamcoback.inference.dto.InferenceResultDto.ResultList;
|
||||||
import com.kamco.cd.kamcoback.inference.dto.InferenceSendDto;
|
import com.kamco.cd.kamcoback.inference.dto.InferenceSendDto;
|
||||||
|
import com.kamco.cd.kamcoback.inference.dto.InferenceSendDto.PredRequestsAreas;
|
||||||
import com.kamco.cd.kamcoback.model.dto.ModelMngDto.Basic;
|
import com.kamco.cd.kamcoback.model.dto.ModelMngDto.Basic;
|
||||||
import com.kamco.cd.kamcoback.postgres.core.InferenceResultCoreService;
|
import com.kamco.cd.kamcoback.postgres.core.InferenceResultCoreService;
|
||||||
import com.kamco.cd.kamcoback.postgres.core.MapSheetMngCoreService;
|
import com.kamco.cd.kamcoback.postgres.core.MapSheetMngCoreService;
|
||||||
@@ -91,13 +92,25 @@ public class InferenceResultService {
|
|||||||
mapSheetNumList.add(mapSheetDto.getMapSheetNum());
|
mapSheetNumList.add(mapSheetDto.getMapSheetNum());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
String modelComparePath =
|
||||||
this.getSceneInference(String.valueOf(req.getCompareYyyy()), mapSheetNumList);
|
this.getSceneInference(String.valueOf(req.getCompareYyyy()), mapSheetNumList);
|
||||||
|
String modelTargetPath =
|
||||||
this.getSceneInference(String.valueOf(req.getTargetYyyy()), mapSheetNumList);
|
this.getSceneInference(String.valueOf(req.getTargetYyyy()), mapSheetNumList);
|
||||||
|
|
||||||
|
PredRequestsAreas predRequestsAreas = new PredRequestsAreas();
|
||||||
|
predRequestsAreas.setInput1_year(req.getCompareYyyy());
|
||||||
|
predRequestsAreas.setInput2_year(req.getTargetYyyy());
|
||||||
|
predRequestsAreas.setInput1_scene_path(modelComparePath);
|
||||||
|
predRequestsAreas.setInput2_scene_path(modelTargetPath);
|
||||||
|
|
||||||
InferenceSendDto m1 = this.getModelInfo(req.getModel1Uuid());
|
InferenceSendDto m1 = this.getModelInfo(req.getModel1Uuid());
|
||||||
InferenceSendDto m2 = this.getModelInfo(req.getModel2Uuid());
|
InferenceSendDto m2 = this.getModelInfo(req.getModel2Uuid());
|
||||||
InferenceSendDto m3 = this.getModelInfo(req.getModel3Uuid());
|
InferenceSendDto m3 = this.getModelInfo(req.getModel3Uuid());
|
||||||
|
|
||||||
|
m1.setPredRequestsAreas(predRequestsAreas);
|
||||||
|
m2.setPredRequestsAreas(predRequestsAreas);
|
||||||
|
m3.setPredRequestsAreas(predRequestsAreas);
|
||||||
|
|
||||||
ensureAccepted(m1);
|
ensureAccepted(m1);
|
||||||
// ensureAccepted(m2);
|
// ensureAccepted(m2);
|
||||||
// ensureAccepted(m3);
|
// ensureAccepted(m3);
|
||||||
@@ -183,8 +196,8 @@ public class InferenceResultService {
|
|||||||
* @param yyyy
|
* @param yyyy
|
||||||
* @param mapSheetNums
|
* @param mapSheetNums
|
||||||
*/
|
*/
|
||||||
private void getSceneInference(String yyyy, List<String> mapSheetNums) {
|
private String getSceneInference(String yyyy, List<String> mapSheetNums) {
|
||||||
mapSheetMngCoreService.getSceneInference(yyyy, mapSheetNums);
|
return mapSheetMngCoreService.getSceneInference(yyyy, mapSheetNums);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -201,20 +201,22 @@ public class MapSheetMngCoreService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void getSceneInference(String yyyy, List<String> scenes) {
|
public String getSceneInference(String yyyy, List<String> scenes) {
|
||||||
|
String outputPath = "";
|
||||||
|
|
||||||
try {
|
try {
|
||||||
List<ImageFeature> sceneInference = mapSheetMngRepository.getSceneInference(yyyy, scenes);
|
List<ImageFeature> sceneInference = mapSheetMngRepository.getSceneInference(yyyy, scenes);
|
||||||
|
|
||||||
if (sceneInference == null || sceneInference.isEmpty()) {
|
if (sceneInference == null || sceneInference.isEmpty()) {
|
||||||
log.warn("No scene data found for year: {}", yyyy);
|
log.warn("No scene data found for year: {}", yyyy);
|
||||||
return;
|
return outputPath;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (activeEnv.equals("local")) {
|
if (activeEnv.equals("local")) {
|
||||||
syncRootDir = System.getProperty("user.home") + "/geojson";
|
syncRootDir = System.getProperty("user.home") + "/geojson";
|
||||||
}
|
}
|
||||||
String filename = String.format("%s_%s.geojson", yyyy, activeEnv);
|
String filename = String.format("%s_%s.geojson", yyyy, activeEnv);
|
||||||
String outputPath = Paths.get(syncRootDir, filename).toString();
|
outputPath = Paths.get(syncRootDir, filename).toString();
|
||||||
|
|
||||||
// 디렉토리가 없으면 생성
|
// 디렉토리가 없으면 생성
|
||||||
Files.createDirectories(Paths.get(syncRootDir));
|
Files.createDirectories(Paths.get(syncRootDir));
|
||||||
@@ -230,5 +232,7 @@ public class MapSheetMngCoreService {
|
|||||||
log.error("Failed to create GeoJSON file for year: {}", yyyy, e);
|
log.error("Failed to create GeoJSON file for year: {}", yyyy, e);
|
||||||
throw new RuntimeException("GeoJSON 파일 생성 실패: " + e.getMessage(), e);
|
throw new RuntimeException("GeoJSON 파일 생성 실패: " + e.getMessage(), e);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return outputPath;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user