Inline
This commit is contained in:
parent
c8623bab12
commit
a161203d0b
1 changed files with 4 additions and 10 deletions
|
@ -113,8 +113,10 @@ const indexFaces_ = async (enteFile: EnteFile, imageBitmap: ImageBitmap) => {
|
|||
}));
|
||||
newMlFile.faces = detectedFaces;
|
||||
|
||||
if (newMlFile.faces && newMlFile.faces.length > 0) {
|
||||
await syncFileFaceCrops(fileContext);
|
||||
if (detectedFaces.length > 0) {
|
||||
await Promise.all(
|
||||
detectedFaces.map((face) => saveFaceCrop(imageBitmap, face)),
|
||||
);
|
||||
|
||||
const alignedFacesData = await syncFileFaceAlignments(fileContext);
|
||||
|
||||
|
@ -339,14 +341,6 @@ const makeFaceID = (
|
|||
return [`${fileID}`, xMin, yMin, xMax, yMax].join("_");
|
||||
};
|
||||
|
||||
const syncFileFaceCrops = async (fileContext: MLSyncFileContext) => {
|
||||
const { newMlFile } = fileContext;
|
||||
const imageBitmap = fileContext.imageBitmap;
|
||||
for (const face of newMlFile.faces) {
|
||||
await saveFaceCrop(imageBitmap, face);
|
||||
}
|
||||
};
|
||||
|
||||
const syncFileFaceAlignments = async (
|
||||
fileContext: MLSyncFileContext,
|
||||
): Promise<Float32Array> => {
|
||||
|
|
Loading…
Add table
Reference in a new issue