mirror of
https://github.com/KevinMidboe/immich.git
synced 2025-10-29 17:40:28 +00:00
feat: facial recognition (#2180)
This commit is contained in:
@@ -3,6 +3,7 @@ import {
|
||||
APIKeyEntity,
|
||||
AssetEntity,
|
||||
AssetType,
|
||||
PersonEntity,
|
||||
PartnerEntity,
|
||||
SharedLinkEntity,
|
||||
SharedLinkType,
|
||||
@@ -10,6 +11,7 @@ import {
|
||||
TranscodePreset,
|
||||
UserEntity,
|
||||
UserTokenEntity,
|
||||
AssetFaceEntity,
|
||||
} from '@app/infra/entities';
|
||||
import {
|
||||
AlbumResponseDto,
|
||||
@@ -142,6 +144,7 @@ export const assetEntityStub = {
|
||||
livePhotoVideoId: null,
|
||||
tags: [],
|
||||
sharedLinks: [],
|
||||
faces: [],
|
||||
}),
|
||||
image: Object.freeze<AssetEntity>({
|
||||
id: 'asset-id',
|
||||
@@ -168,6 +171,7 @@ export const assetEntityStub = {
|
||||
tags: [],
|
||||
sharedLinks: [],
|
||||
originalFileName: 'asset-id.ext',
|
||||
faces: [],
|
||||
}),
|
||||
video: Object.freeze<AssetEntity>({
|
||||
id: 'asset-id',
|
||||
@@ -194,6 +198,7 @@ export const assetEntityStub = {
|
||||
livePhotoVideoId: null,
|
||||
tags: [],
|
||||
sharedLinks: [],
|
||||
faces: [],
|
||||
}),
|
||||
livePhotoMotionAsset: Object.freeze({
|
||||
id: 'live-photo-motion-asset',
|
||||
@@ -372,6 +377,7 @@ const assetResponse: AssetResponseDto = {
|
||||
exifInfo: assetInfo,
|
||||
livePhotoVideoId: null,
|
||||
tags: [],
|
||||
people: [],
|
||||
};
|
||||
|
||||
const albumResponse: AlbumResponseDto = {
|
||||
@@ -655,6 +661,7 @@ export const sharedLinkStub = {
|
||||
},
|
||||
tags: [],
|
||||
sharedLinks: [],
|
||||
faces: [],
|
||||
},
|
||||
],
|
||||
},
|
||||
@@ -729,6 +736,7 @@ export const searchStub = {
|
||||
page: 1,
|
||||
items: [],
|
||||
facets: [],
|
||||
distances: [],
|
||||
}),
|
||||
};
|
||||
|
||||
@@ -826,6 +834,39 @@ export const probeStub = {
|
||||
}),
|
||||
};
|
||||
|
||||
export const personStub = {
|
||||
noName: Object.freeze<PersonEntity>({
|
||||
id: 'person-1',
|
||||
createdAt: new Date('2021-01-01'),
|
||||
updatedAt: new Date('2021-01-01'),
|
||||
ownerId: userEntityStub.admin.id,
|
||||
owner: userEntityStub.admin,
|
||||
name: '',
|
||||
thumbnailPath: '/path/to/thumbnail',
|
||||
faces: [],
|
||||
}),
|
||||
withName: Object.freeze<PersonEntity>({
|
||||
id: 'person-1',
|
||||
createdAt: new Date('2021-01-01'),
|
||||
updatedAt: new Date('2021-01-01'),
|
||||
ownerId: userEntityStub.admin.id,
|
||||
owner: userEntityStub.admin,
|
||||
name: 'Person 1',
|
||||
thumbnailPath: '/path/to/thumbnail',
|
||||
faces: [],
|
||||
}),
|
||||
noThumbnail: Object.freeze<PersonEntity>({
|
||||
id: 'person-1',
|
||||
createdAt: new Date('2021-01-01'),
|
||||
updatedAt: new Date('2021-01-01'),
|
||||
ownerId: userEntityStub.admin.id,
|
||||
owner: userEntityStub.admin,
|
||||
name: '',
|
||||
thumbnailPath: '',
|
||||
faces: [],
|
||||
}),
|
||||
};
|
||||
|
||||
export const partnerStub = {
|
||||
adminToUser1: Object.freeze<PartnerEntity>({
|
||||
createdAt: new Date('2023-02-23T05:06:29.716Z'),
|
||||
@@ -844,3 +885,13 @@ export const partnerStub = {
|
||||
sharedWith: userEntityStub.admin,
|
||||
}),
|
||||
};
|
||||
|
||||
export const faceStub = {
|
||||
face1: Object.freeze<AssetFaceEntity>({
|
||||
assetId: assetEntityStub.image.id,
|
||||
asset: assetEntityStub.image,
|
||||
personId: personStub.withName.id,
|
||||
person: personStub.withName,
|
||||
embedding: [1, 2, 3, 4],
|
||||
}),
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user