diff --git a/backend/src/main/java/com/worlabel/domain/model/entity/dto/AiModelResponse.java b/backend/src/main/java/com/worlabel/domain/model/entity/dto/AiModelResponse.java index 4679405..c4f9514 100644 --- a/backend/src/main/java/com/worlabel/domain/model/entity/dto/AiModelResponse.java +++ b/backend/src/main/java/com/worlabel/domain/model/entity/dto/AiModelResponse.java @@ -1,6 +1,7 @@ package com.worlabel.domain.model.entity.dto; import com.worlabel.domain.model.entity.AiModel; +import com.worlabel.domain.project.entity.ProjectType; import io.swagger.v3.oas.annotations.media.Schema; import lombok.AccessLevel; import lombok.AllArgsConstructor; @@ -23,7 +24,10 @@ public class AiModelResponse { @Schema(description = "모델 학습 여부", example = "true") private Boolean isTrain; - public static AiModelResponse of(final AiModel aiModel, final int progressModelId) { - return new AiModelResponse(aiModel.getId(), aiModel.getName(), aiModel.getProject() == null, aiModel.getId() == progressModelId); + @Schema(description = "모델 종류", example = "classification") + private ProjectType projectType; + + public static AiModelResponse of(final AiModel aiModel, final int progressModelId, final ProjectType projectType) { + return new AiModelResponse(aiModel.getId(), aiModel.getName(), aiModel.getProject() == null, aiModel.getId() == progressModelId, projectType); } } diff --git a/backend/src/main/java/com/worlabel/domain/model/service/AiModelService.java b/backend/src/main/java/com/worlabel/domain/model/service/AiModelService.java index d315f9c..7e62a56 100644 --- a/backend/src/main/java/com/worlabel/domain/model/service/AiModelService.java +++ b/backend/src/main/java/com/worlabel/domain/model/service/AiModelService.java @@ -56,10 +56,11 @@ public class AiModelService { @Transactional(readOnly = true) public List getModelList(final Integer projectId) { + Project project = getProject(projectId); int progressModelId = progressService.getProgressModelByProjectId(projectId); return aiModelRepository.findAllByProjectId(projectId) .stream() - .map(o -> AiModelResponse.of(o, progressModelId)) + .map(o -> AiModelResponse.of(o, progressModelId, project.getProjectType())) .toList(); } diff --git a/backend/src/main/java/com/worlabel/domain/report/entity/Report.java b/backend/src/main/java/com/worlabel/domain/report/entity/Report.java index bdda057..70c1894 100644 --- a/backend/src/main/java/com/worlabel/domain/report/entity/Report.java +++ b/backend/src/main/java/com/worlabel/domain/report/entity/Report.java @@ -56,6 +56,9 @@ public class Report extends BaseEntity { @Column(name = "left_second", nullable = false) private double leftSecond; + @Column(name = "seg_loss", nullable = false) + private double segLoss; + private Report(final AiModel aiModel, final Integer epoch, final Integer totalEpochs, @@ -64,7 +67,8 @@ public class Report extends BaseEntity { final double dflLoss, final double fitness, final double epochTime, - final double leftSecond) { + final double leftSecond, + final double segLoss) { this.aiModel = aiModel; this.epoch = epoch; this.totalEpochs = totalEpochs; @@ -74,6 +78,7 @@ public class Report extends BaseEntity { this.fitness = fitness; this.epochTime = epochTime; this.leftSecond = leftSecond; + this.segLoss = segLoss; } public static Report of(final AiModel aiModel, @@ -84,7 +89,8 @@ public class Report extends BaseEntity { final double dflLoss, final double fitness, final double epochTime, - final double leftSecond) { - return new Report(aiModel, epoch, totalEpochs, boxLoss, clsLoss, dflLoss, fitness, epochTime, leftSecond); + final double leftSecond, + final double segLoss) { + return new Report(aiModel, epoch, totalEpochs, boxLoss, clsLoss, dflLoss, fitness, epochTime, leftSecond, segLoss); } } diff --git a/backend/src/main/java/com/worlabel/domain/report/entity/dto/ReportRequest.java b/backend/src/main/java/com/worlabel/domain/report/entity/dto/ReportRequest.java index c012f5a..fd329d9 100644 --- a/backend/src/main/java/com/worlabel/domain/report/entity/dto/ReportRequest.java +++ b/backend/src/main/java/com/worlabel/domain/report/entity/dto/ReportRequest.java @@ -18,4 +18,5 @@ public class ReportRequest { private double fitness; private double epochTime; private double leftSeconds; + private double segLoss; } \ No newline at end of file diff --git a/backend/src/main/java/com/worlabel/domain/report/entity/dto/ReportResponse.java b/backend/src/main/java/com/worlabel/domain/report/entity/dto/ReportResponse.java index 541366c..f055787 100644 --- a/backend/src/main/java/com/worlabel/domain/report/entity/dto/ReportResponse.java +++ b/backend/src/main/java/com/worlabel/domain/report/entity/dto/ReportResponse.java @@ -18,6 +18,7 @@ public class ReportResponse { private double fitness; private double epochTime; private double leftSecond; + private double segLoss; public static ReportResponse from(final Report report) { return new ReportResponse( @@ -29,7 +30,8 @@ public class ReportResponse { report.getDflLoss(), report.getFitness(), report.getEpochTime(), - report.getLeftSecond() + report.getLeftSecond(), + report.getSegLoss() ); } @@ -43,7 +45,8 @@ public class ReportResponse { report.getDflLoss(), report.getFitness(), report.getEpochTime(), - report.getLeftSeconds() + report.getLeftSeconds(), + report.getSegLoss() ); } } \ No newline at end of file diff --git a/backend/src/main/java/com/worlabel/domain/report/service/ReportService.java b/backend/src/main/java/com/worlabel/domain/report/service/ReportService.java index c7f949c..7bf4f02 100644 --- a/backend/src/main/java/com/worlabel/domain/report/service/ReportService.java +++ b/backend/src/main/java/com/worlabel/domain/report/service/ReportService.java @@ -64,7 +64,8 @@ public class ReportService { reportResponse.getDflLoss(), reportResponse.getFitness(), reportResponse.getEpochTime(), - reportResponse.getLeftSecond()); + reportResponse.getLeftSecond(), + reportResponse.getSegLoss()); reports.add(report); }