use original image for ml

This commit is contained in:
mertalev
2025-05-13 23:41:57 -04:00
parent c15507baad
commit 016a760dda
5 changed files with 10 additions and 77 deletions
+5 -4
View File
@@ -290,8 +290,7 @@ export class PersonService extends BaseService {
}
const asset = await this.assetJobRepository.getForDetectFacesJob(id);
const previewFile = asset?.files[0];
if (!asset || asset.files.length !== 1 || !previewFile) {
if (!asset) {
return JobStatus.FAILED;
}
@@ -301,10 +300,12 @@ export class PersonService extends BaseService {
const { imageHeight, imageWidth, faces } = await this.machineLearningRepository.detectFaces(
machineLearning.urls,
previewFile.path,
asset.originalPath,
machineLearning.facialRecognition,
);
this.logger.debug(`${faces.length} faces detected in ${previewFile.path}`);
this.logger.debug(
`${faces.length} faces detected in ${asset.originalPath} with scores ${faces.map((f) => f.score)}`,
);
const facesToAdd: (Insertable<AssetFaces> & { id: string })[] = [];
const embeddings: FaceSearch[] = [];