mirror of
https://github.com/immich-app/immich
synced 2025-11-07 17:27:20 +00:00
feat(server): optimize partial facial recognition (#6634)
* optimize partial facial recognition * add tests * use map * bulk insert faces
This commit is contained in:
parent
852effa998
commit
bd87eb309c
9 changed files with 77 additions and 46 deletions
|
|
@ -38,11 +38,13 @@ describe(`${PersonController.name}`, () => {
|
|||
name: 'visible_person',
|
||||
thumbnailPath: '/thumbnail/face_asset',
|
||||
});
|
||||
await personRepository.createFace({
|
||||
assetId: faceAsset.id,
|
||||
personId: visiblePerson.id,
|
||||
embedding: Array.from({ length: 512 }, Math.random),
|
||||
});
|
||||
await personRepository.createFaces([
|
||||
{
|
||||
assetId: faceAsset.id,
|
||||
personId: visiblePerson.id,
|
||||
embedding: Array.from({ length: 512 }, Math.random),
|
||||
},
|
||||
]);
|
||||
|
||||
hiddenPerson = await personRepository.create({
|
||||
ownerId: loginResponse.userId,
|
||||
|
|
@ -50,11 +52,13 @@ describe(`${PersonController.name}`, () => {
|
|||
isHidden: true,
|
||||
thumbnailPath: '/thumbnail/face_asset',
|
||||
});
|
||||
await personRepository.createFace({
|
||||
assetId: faceAsset.id,
|
||||
personId: hiddenPerson.id,
|
||||
embedding: Array.from({ length: 512 }, Math.random),
|
||||
});
|
||||
await personRepository.createFaces([
|
||||
{
|
||||
assetId: faceAsset.id,
|
||||
personId: hiddenPerson.id,
|
||||
embedding: Array.from({ length: 512 }, Math.random),
|
||||
},
|
||||
]);
|
||||
});
|
||||
|
||||
describe('GET /person', () => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue