Loading backend/src/main/java/cz/fidentis/web/analyticaltask/distance/DistanceTaskServiceImpl.java +1 −1 Original line number Diff line number Diff line Loading @@ -153,7 +153,7 @@ public class DistanceTaskServiceImpl implements DistanceTaskService { private Map<Landmark, Double> getLandmarkRadii(DistanceTaskDto dto, HumanFace secondaryFace) { return dto.getFeaturePointSizes().stream() .collect(Collectors.toMap( f -> secondaryFace.getAllLandmarks().stream() f -> secondaryFace.getLandmarks().getAllLandmarks().stream() .filter(fp -> fp.getName().equals(f.getName())) .findAny().orElse(null), DistanceTaskDto.FeaturePointSize::getSize)); Loading backend/src/main/java/cz/fidentis/web/analyticaltask/registration/RegistrationTaskServiceImpl.java +1 −1 Original line number Diff line number Diff line Loading @@ -56,7 +56,7 @@ public class RegistrationTaskServiceImpl implements RegistrationTaskService { return HumanFaceDto.builder() .id(secondaryFace.getId()) .geometry(new HumanFaceGeometryDto(secondaryFace, true)) .featurePoints(secondaryFace.getHumanFace().hasLandmarks() ? .featurePoints(secondaryFace.getHumanFace().getLandmarks().hasLandmarks() ? new HumanFaceFeaturePointsDto(secondaryFace) : null) .symmetryPlane(secondaryFace.getHumanFace().hasSymmetryPlane() ? new HumanFaceSymmetryPlaneDto(secondaryFace) : null) Loading backend/src/main/java/cz/fidentis/web/batchprocessing/registration/BatchRegistrationServiceImpl.java +7 −4 Original line number Diff line number Diff line package cz.fidentis.web.batchprocessing.registration; import cz.fidentis.analyst.Logger; import cz.fidentis.analyst.data.face.HumanFace; import cz.fidentis.analyst.data.face.HumanFaceFactory; import cz.fidentis.analyst.data.mesh.MeshIO; Loading Loading @@ -32,6 +31,8 @@ import jakarta.persistence.EntityManager; import jakarta.persistence.PersistenceContext; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.SerializationUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.scheduling.annotation.Async; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; Loading @@ -53,6 +54,8 @@ import java.util.concurrent.CompletionException; @Slf4j public class BatchRegistrationServiceImpl extends BatchBaseService implements BatchRegistrationService { private static final Logger LOGGER = LoggerFactory.getLogger(BatchRegistrationServiceImpl.class); @PersistenceContext private EntityManager em; Loading Loading @@ -124,7 +127,7 @@ public class BatchRegistrationServiceImpl extends BatchBaseService implements Ba double newPSM = procrustesSurfaceMetric(selectedFace, newAvgFace); double psmDiff = Math.abs(prevPSM - newPSM); Logger.print("Iter. " + iter + " (PSM, |diff|): " + newPSM + ", " + psmDiff); LOGGER.info("Iter. " + iter + " (PSM, |diff|): " + newPSM + ", " + psmDiff); if (psmDiff < dto.getAveragingTaskDto().getStabilizationThreshold()) { break; Loading Loading @@ -177,7 +180,7 @@ public class BatchRegistrationServiceImpl extends BatchBaseService implements Ba try { return doInBackground(dto).join(); } catch (CompletionException | IOException ex) { Logger.print(ex.getCause().toString()); LOGGER.error(ex.getCause().toString()); return new RegistrationResultDto(null, false); } } Loading Loading @@ -244,7 +247,7 @@ public class BatchRegistrationServiceImpl extends BatchBaseService implements Ba try { MeshIO.exportMeshModel(newAvgFace.getMeshModel(), tempFile); } catch (IOException ex) { Logger.print(ex.toString()); LOGGER.error(ex.toString()); } return newAvgFace; Loading backend/src/main/java/cz/fidentis/web/humanface/TaskFaceInfo.java +2 −2 Original line number Diff line number Diff line Loading @@ -51,8 +51,8 @@ public class TaskFaceInfo implements Serializable { this.previewPhotoData = faceInfo.getPreviewPhotoData(); this.numberOfVertices = faceInfo.getNumberOfVertices(); this.numberOfFacets = faceInfo.getNumberOfFacets(); this.featurePointsNames = face.hasLandmarks() ? face.getAllLandmarks().stream().map(f -> f.getName()).toList() this.featurePointsNames = face.getLandmarks().hasLandmarks() ? face.getLandmarks().getAllLandmarks().stream().map(f -> f.getName()).toList() : null; } } backend/src/main/java/cz/fidentis/web/humanface/dto/HumanFaceDto.java +1 −1 Original line number Diff line number Diff line Loading @@ -38,7 +38,7 @@ public class HumanFaceDto { this.id = humanFaceEntity.getId(); this.isPrimaryFace = humanFaceEntity.getIsPrimaryFace(); this.isAverageFace = humanFaceEntity.getIsAverageFace(); this.hasFeaturePoints = humanFaceEntity.getHumanFace().hasLandmarks(); this.hasFeaturePoints = humanFaceEntity.getHumanFace().getLandmarks().hasLandmarks(); this.hasSymmetryPlane = humanFaceEntity.getHumanFace().hasSymmetryPlane(); this.info = humanFaceEntity.getHelperHumanFace().getTaskFaceInfo(); Loading Loading
backend/src/main/java/cz/fidentis/web/analyticaltask/distance/DistanceTaskServiceImpl.java +1 −1 Original line number Diff line number Diff line Loading @@ -153,7 +153,7 @@ public class DistanceTaskServiceImpl implements DistanceTaskService { private Map<Landmark, Double> getLandmarkRadii(DistanceTaskDto dto, HumanFace secondaryFace) { return dto.getFeaturePointSizes().stream() .collect(Collectors.toMap( f -> secondaryFace.getAllLandmarks().stream() f -> secondaryFace.getLandmarks().getAllLandmarks().stream() .filter(fp -> fp.getName().equals(f.getName())) .findAny().orElse(null), DistanceTaskDto.FeaturePointSize::getSize)); Loading
backend/src/main/java/cz/fidentis/web/analyticaltask/registration/RegistrationTaskServiceImpl.java +1 −1 Original line number Diff line number Diff line Loading @@ -56,7 +56,7 @@ public class RegistrationTaskServiceImpl implements RegistrationTaskService { return HumanFaceDto.builder() .id(secondaryFace.getId()) .geometry(new HumanFaceGeometryDto(secondaryFace, true)) .featurePoints(secondaryFace.getHumanFace().hasLandmarks() ? .featurePoints(secondaryFace.getHumanFace().getLandmarks().hasLandmarks() ? new HumanFaceFeaturePointsDto(secondaryFace) : null) .symmetryPlane(secondaryFace.getHumanFace().hasSymmetryPlane() ? new HumanFaceSymmetryPlaneDto(secondaryFace) : null) Loading
backend/src/main/java/cz/fidentis/web/batchprocessing/registration/BatchRegistrationServiceImpl.java +7 −4 Original line number Diff line number Diff line package cz.fidentis.web.batchprocessing.registration; import cz.fidentis.analyst.Logger; import cz.fidentis.analyst.data.face.HumanFace; import cz.fidentis.analyst.data.face.HumanFaceFactory; import cz.fidentis.analyst.data.mesh.MeshIO; Loading Loading @@ -32,6 +31,8 @@ import jakarta.persistence.EntityManager; import jakarta.persistence.PersistenceContext; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.SerializationUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.scheduling.annotation.Async; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; Loading @@ -53,6 +54,8 @@ import java.util.concurrent.CompletionException; @Slf4j public class BatchRegistrationServiceImpl extends BatchBaseService implements BatchRegistrationService { private static final Logger LOGGER = LoggerFactory.getLogger(BatchRegistrationServiceImpl.class); @PersistenceContext private EntityManager em; Loading Loading @@ -124,7 +127,7 @@ public class BatchRegistrationServiceImpl extends BatchBaseService implements Ba double newPSM = procrustesSurfaceMetric(selectedFace, newAvgFace); double psmDiff = Math.abs(prevPSM - newPSM); Logger.print("Iter. " + iter + " (PSM, |diff|): " + newPSM + ", " + psmDiff); LOGGER.info("Iter. " + iter + " (PSM, |diff|): " + newPSM + ", " + psmDiff); if (psmDiff < dto.getAveragingTaskDto().getStabilizationThreshold()) { break; Loading Loading @@ -177,7 +180,7 @@ public class BatchRegistrationServiceImpl extends BatchBaseService implements Ba try { return doInBackground(dto).join(); } catch (CompletionException | IOException ex) { Logger.print(ex.getCause().toString()); LOGGER.error(ex.getCause().toString()); return new RegistrationResultDto(null, false); } } Loading Loading @@ -244,7 +247,7 @@ public class BatchRegistrationServiceImpl extends BatchBaseService implements Ba try { MeshIO.exportMeshModel(newAvgFace.getMeshModel(), tempFile); } catch (IOException ex) { Logger.print(ex.toString()); LOGGER.error(ex.toString()); } return newAvgFace; Loading
backend/src/main/java/cz/fidentis/web/humanface/TaskFaceInfo.java +2 −2 Original line number Diff line number Diff line Loading @@ -51,8 +51,8 @@ public class TaskFaceInfo implements Serializable { this.previewPhotoData = faceInfo.getPreviewPhotoData(); this.numberOfVertices = faceInfo.getNumberOfVertices(); this.numberOfFacets = faceInfo.getNumberOfFacets(); this.featurePointsNames = face.hasLandmarks() ? face.getAllLandmarks().stream().map(f -> f.getName()).toList() this.featurePointsNames = face.getLandmarks().hasLandmarks() ? face.getLandmarks().getAllLandmarks().stream().map(f -> f.getName()).toList() : null; } }
backend/src/main/java/cz/fidentis/web/humanface/dto/HumanFaceDto.java +1 −1 Original line number Diff line number Diff line Loading @@ -38,7 +38,7 @@ public class HumanFaceDto { this.id = humanFaceEntity.getId(); this.isPrimaryFace = humanFaceEntity.getIsPrimaryFace(); this.isAverageFace = humanFaceEntity.getIsAverageFace(); this.hasFeaturePoints = humanFaceEntity.getHumanFace().hasLandmarks(); this.hasFeaturePoints = humanFaceEntity.getHumanFace().getLandmarks().hasLandmarks(); this.hasSymmetryPlane = humanFaceEntity.getHumanFace().hasSymmetryPlane(); this.info = humanFaceEntity.getHelperHumanFace().getTaskFaceInfo(); Loading