Refactor: Report segLoss 컬럼 추가 - S11P21S002-223
This commit is contained in:
parent
b84e06baba
commit
e5a1c9b373
@ -1,6 +1,7 @@
|
|||||||
package com.worlabel.domain.model.entity.dto;
|
package com.worlabel.domain.model.entity.dto;
|
||||||
|
|
||||||
import com.worlabel.domain.model.entity.AiModel;
|
import com.worlabel.domain.model.entity.AiModel;
|
||||||
|
import com.worlabel.domain.project.entity.ProjectType;
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import lombok.AccessLevel;
|
import lombok.AccessLevel;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
@ -23,7 +24,10 @@ public class AiModelResponse {
|
|||||||
@Schema(description = "모델 학습 여부", example = "true")
|
@Schema(description = "모델 학습 여부", example = "true")
|
||||||
private Boolean isTrain;
|
private Boolean isTrain;
|
||||||
|
|
||||||
public static AiModelResponse of(final AiModel aiModel, final int progressModelId) {
|
@Schema(description = "모델 종류", example = "classification")
|
||||||
return new AiModelResponse(aiModel.getId(), aiModel.getName(), aiModel.getProject() == null, aiModel.getId() == progressModelId);
|
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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -54,10 +54,11 @@ public class AiModelService {
|
|||||||
|
|
||||||
@Transactional(readOnly = true)
|
@Transactional(readOnly = true)
|
||||||
public List<AiModelResponse> getModelList(final Integer projectId) {
|
public List<AiModelResponse> getModelList(final Integer projectId) {
|
||||||
|
Project project = getProject(projectId);
|
||||||
int progressModelId = progressService.getProgressModelByProjectId(projectId);
|
int progressModelId = progressService.getProgressModelByProjectId(projectId);
|
||||||
return aiModelRepository.findAllByProjectId(projectId)
|
return aiModelRepository.findAllByProjectId(projectId)
|
||||||
.stream()
|
.stream()
|
||||||
.map(o -> AiModelResponse.of(o, progressModelId))
|
.map(o -> AiModelResponse.of(o, progressModelId, project.getProjectType()))
|
||||||
.toList();
|
.toList();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -56,6 +56,9 @@ public class Report extends BaseEntity {
|
|||||||
@Column(name = "left_second", nullable = false)
|
@Column(name = "left_second", nullable = false)
|
||||||
private double leftSecond;
|
private double leftSecond;
|
||||||
|
|
||||||
|
@Column(name = "seg_loss", nullable = false)
|
||||||
|
private double segLoss;
|
||||||
|
|
||||||
private Report(final AiModel aiModel,
|
private Report(final AiModel aiModel,
|
||||||
final Integer epoch,
|
final Integer epoch,
|
||||||
final Integer totalEpochs,
|
final Integer totalEpochs,
|
||||||
@ -64,7 +67,8 @@ public class Report extends BaseEntity {
|
|||||||
final double dflLoss,
|
final double dflLoss,
|
||||||
final double fitness,
|
final double fitness,
|
||||||
final double epochTime,
|
final double epochTime,
|
||||||
final double leftSecond) {
|
final double leftSecond,
|
||||||
|
final double segLoss) {
|
||||||
this.aiModel = aiModel;
|
this.aiModel = aiModel;
|
||||||
this.epoch = epoch;
|
this.epoch = epoch;
|
||||||
this.totalEpochs = totalEpochs;
|
this.totalEpochs = totalEpochs;
|
||||||
@ -74,6 +78,7 @@ public class Report extends BaseEntity {
|
|||||||
this.fitness = fitness;
|
this.fitness = fitness;
|
||||||
this.epochTime = epochTime;
|
this.epochTime = epochTime;
|
||||||
this.leftSecond = leftSecond;
|
this.leftSecond = leftSecond;
|
||||||
|
this.segLoss = segLoss;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Report of(final AiModel aiModel,
|
public static Report of(final AiModel aiModel,
|
||||||
@ -84,7 +89,8 @@ public class Report extends BaseEntity {
|
|||||||
final double dflLoss,
|
final double dflLoss,
|
||||||
final double fitness,
|
final double fitness,
|
||||||
final double epochTime,
|
final double epochTime,
|
||||||
final double leftSecond) {
|
final double leftSecond,
|
||||||
return new Report(aiModel, epoch, totalEpochs, boxLoss, clsLoss, dflLoss, fitness, epochTime, leftSecond);
|
final double segLoss) {
|
||||||
|
return new Report(aiModel, epoch, totalEpochs, boxLoss, clsLoss, dflLoss, fitness, epochTime, leftSecond, segLoss);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -18,4 +18,5 @@ public class ReportRequest {
|
|||||||
private double fitness;
|
private double fitness;
|
||||||
private double epochTime;
|
private double epochTime;
|
||||||
private double leftSeconds;
|
private double leftSeconds;
|
||||||
|
private double segLoss;
|
||||||
}
|
}
|
@ -18,6 +18,7 @@ public class ReportResponse {
|
|||||||
private double fitness;
|
private double fitness;
|
||||||
private double epochTime;
|
private double epochTime;
|
||||||
private double leftSecond;
|
private double leftSecond;
|
||||||
|
private double segLoss;
|
||||||
|
|
||||||
public static ReportResponse from(final Report report) {
|
public static ReportResponse from(final Report report) {
|
||||||
return new ReportResponse(
|
return new ReportResponse(
|
||||||
@ -29,7 +30,8 @@ public class ReportResponse {
|
|||||||
report.getDflLoss(),
|
report.getDflLoss(),
|
||||||
report.getFitness(),
|
report.getFitness(),
|
||||||
report.getEpochTime(),
|
report.getEpochTime(),
|
||||||
report.getLeftSecond()
|
report.getLeftSecond(),
|
||||||
|
report.getSegLoss()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -43,7 +45,8 @@ public class ReportResponse {
|
|||||||
report.getDflLoss(),
|
report.getDflLoss(),
|
||||||
report.getFitness(),
|
report.getFitness(),
|
||||||
report.getEpochTime(),
|
report.getEpochTime(),
|
||||||
report.getLeftSeconds()
|
report.getLeftSeconds(),
|
||||||
|
report.getSegLoss()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -64,7 +64,8 @@ public class ReportService {
|
|||||||
reportResponse.getDflLoss(),
|
reportResponse.getDflLoss(),
|
||||||
reportResponse.getFitness(),
|
reportResponse.getFitness(),
|
||||||
reportResponse.getEpochTime(),
|
reportResponse.getEpochTime(),
|
||||||
reportResponse.getLeftSecond());
|
reportResponse.getLeftSecond(),
|
||||||
|
reportResponse.getSegLoss());
|
||||||
|
|
||||||
reports.add(report);
|
reports.add(report);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user