Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(server): Import face regions from metadata #6455

Merged
merged 79 commits into from
Sep 4, 2024
Merged
Show file tree
Hide file tree
Changes from 75 commits
Commits
Show all changes
79 commits
Select commit Hold shift + click to select a range
eca76ff
feat: faces-from-metadata - Import face regions from metadata
bugfest Jan 17, 2024
72662f8
chore(web): remove unused file confirm-enable-import-faces
bugfest Jul 18, 2024
260477e
chore(web): format metadata-settings
bugfest Jul 18, 2024
3506bba
fix(server): faces-from-metadata tests and format
bugfest Jul 18, 2024
c9c85e1
fix(server): code refinements, nullable face asset sourceType
bugfest Jul 20, 2024
4dc738e
fix(server): Add RegionInfo to ImmichTags interface
bugfest Jul 20, 2024
bfd601c
fix(server): deleteAllFaces sourceType param can be undefined
bugfest Jul 20, 2024
cda160f
fix(server): exiftool-vendored 27.0.0 moves readArgs into ExifToolOpt…
bugfest Jul 20, 2024
c534237
fix(server): rename isImportFacesFromMetadataEnabled to isFaceImportE…
bugfest Jul 28, 2024
ba0ab48
fix(server): simplify sourceType conditional
bugfest Jul 28, 2024
9363ea9
fix(server): small fixes
bugfest Jul 28, 2024
cef5218
fix(server): handling sourceType
bugfest Jul 28, 2024
0150af6
fix(server): sourceType enum
bugfest Jul 28, 2024
64686dc
fix(server): refactor metadata applyTaggedFaces
bugfest Jul 30, 2024
2f38c83
Merge branch 'main' into faces-from-metadata
bugfest Jul 30, 2024
525ae57
Merge branch 'main' into faces-from-metadata
bugfest Jul 31, 2024
cd16a21
Merge branch 'main' into faces-from-metadata
bugfest Jul 31, 2024
b9b70ea
fix(server): create/update signature changes
bugfest Aug 1, 2024
6e3fe97
fix(server): reduce computational cost of Person.getManyByName
bugfest Aug 1, 2024
8139a76
fix(server): use faceList instead of faceSet
bugfest Aug 1, 2024
37d8bc1
fix(server): Skip regions without Name defined
bugfest Aug 1, 2024
f6bec01
fix(mobile): Update open-api (face assets feature changes)
bugfest Aug 2, 2024
f2856d9
fix(server): Face-Person reconciliation with map/index
bugfest Aug 2, 2024
86aa3e3
fix(server): tags.RegionInfo.AppliedToDimensions must be defined to p…
bugfest Aug 2, 2024
913d66a
fix(server): fix shared-link.service.ts format
bugfest Aug 2, 2024
28514aa
Merge branch 'main' into faces-from-metadata
bugfest Aug 2, 2024
325c36b
fix(mobile): Update open-api after branch update
bugfest Aug 2, 2024
729bb5c
simplify
mertalev Aug 6, 2024
b4edd6c
Merge branch 'main' into faces-from-metadata
bugfest Aug 7, 2024
f976ab6
Merge branch 'main' into faces-from-metadata
bugfest Aug 8, 2024
bbd69b5
fix(server): minor fixes
bugfest Aug 8, 2024
e87daae
Merge branch 'main' into faces-from-metadata
bugfest Aug 8, 2024
2b362bb
fix(server): person create/update methods type enforcement
bugfest Aug 11, 2024
4bce98c
fix(server): style fixes
bugfest Aug 12, 2024
3f3e177
Merge branch 'main' into faces-from-metadata
bugfest Aug 12, 2024
a9e1736
Merge branch 'main' into faces-from-metadata
bugfest Aug 13, 2024
ac7bb57
fix(server): remove unused metadata code
bugfest Aug 13, 2024
583f210
fix(server): metadata faces unit tests
bugfest Aug 13, 2024
20946ee
fix(server): top level config metadata category
bugfest Aug 15, 2024
2317928
fix(server): rename upsertFaces to replaceFaces
bugfest Aug 15, 2024
e9d71c1
fix(server): remove sourceType when unnecessary
bugfest Aug 15, 2024
2f2e288
fix(server): sourceType as ENUM
bugfest Aug 15, 2024
4e3043f
fix(server): format fixes
bugfest Aug 15, 2024
b5aa8df
fix(server): fix tests after sourceType ENUM change
bugfest Aug 15, 2024
d107e75
fix(server): remove unnecessary JobItem cast
bugfest Aug 15, 2024
1e17717
Merge branch 'main' into faces-from-metadata
bugfest Aug 15, 2024
709cf91
fix(server): fix asset enum imports
bugfest Aug 15, 2024
dfee76d
fix(open-api): add metadata config
bugfest Aug 15, 2024
2a13705
fix(mobile): update open-api after metadata open-api spec changes
bugfest Aug 15, 2024
342f0bb
fix(web): update web/api metadata config
bugfest Aug 15, 2024
e263a05
fix(server): remove duplicated sourceType def
bugfest Aug 15, 2024
f8d1758
Merge branch 'main' into faces-from-metadata
bugfest Aug 15, 2024
d96db15
fix(server): update generated sql queries
bugfest Aug 15, 2024
a0ded5b
fix(e2e): tests for metadata face import feature
bugfest Aug 15, 2024
25acccd
fix(web): Fix check:typescript
bugfest Aug 15, 2024
e7f8b2e
fix(e2e): update subproject ref
bugfest Aug 15, 2024
3a8545a
Merge branch 'main' into faces-from-metadata
bugfest Aug 15, 2024
08e60c3
fix(server): revert format changes to pass format checks after ci
bugfest Aug 15, 2024
3ca4f34
fix(mobile): update open-api
bugfest Aug 15, 2024
41c6f72
Merge branch 'main' into faces-from-metadata
bugfest Aug 15, 2024
1434979
fix(server,movile,open-api,mobile): sourceType as DB data type
bugfest Aug 16, 2024
b3d4075
Merge branch 'main' into faces-from-metadata
bugfest Aug 16, 2024
754c375
fix(e2e): upload face asset after enabling metadata face import
bugfest Aug 16, 2024
6289e0e
fix(web): simplify metadata admin settings and i18n keys
bugfest Aug 16, 2024
2183b12
Update person.repository.ts
mertalev Aug 17, 2024
603128c
Merge branch 'main' into faces-from-metadata
bugfest Aug 17, 2024
feea44a
fix(server): asset_faces.sourceType column not nullable
bugfest Aug 17, 2024
8589b4a
fix(server): simplified syntax
bugfest Aug 17, 2024
a07d425
fix(e2e): use SDK for everything except the endpoint being tested
bugfest Aug 17, 2024
aeb1ce6
fix(e2e): fix test format
bugfest Aug 17, 2024
fe1229a
Merge remote-tracking branch 'origin/main' into faces-from-metadata
bugfest Aug 25, 2024
e92ed11
Merge branch 'main' into faces-from-metadata
bugfest Aug 27, 2024
980d7e2
Merge branch 'main' into faces-from-metadata
bugfest Aug 28, 2024
c1ae1d3
Merge branch 'main' into faces-from-metadata
bugfest Aug 28, 2024
e3a5bae
chore: clean up
jrasm91 Aug 30, 2024
afe8fd4
chore: clean up
jrasm91 Aug 30, 2024
c2fe111
chore: merge main
jrasm91 Aug 30, 2024
548d49c
chore: update e2e/test-assets
bugfest Aug 30, 2024
e898e2f
Merge branch 'main' into faces-from-metadata
mertalev Sep 4, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 64 additions & 0 deletions e2e/src/api/specs/asset.e2e-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ import {
LoginResponseDto,
SharedLinkType,
getAssetInfo,
getConfig,
getMyUser,
updateConfig,
} from '@immich/sdk';
import { exiftool } from 'exiftool-vendored';
import { DateTime } from 'luxon';
Expand Down Expand Up @@ -43,6 +45,9 @@ const TEN_TIMES = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9];

const locationAssetFilepath = `${testAssetDir}/metadata/gps-position/thompson-springs.jpg`;
const ratingAssetFilepath = `${testAssetDir}/metadata/rating/mongolels.jpg`;
const facesAssetFilepath = `${testAssetDir}/metadata/faces/portrait.jpg`;

const getSystemConfig = (accessToken: string) => getConfig({ headers: asBearerAuth(accessToken) });

const readTags = async (bytes: Buffer, filename: string) => {
const filepath = join(tempDir, filename);
Expand Down Expand Up @@ -71,6 +76,7 @@ describe('/asset', () => {
let user2Assets: AssetMediaResponseDto[];
let locationAsset: AssetMediaResponseDto;
let ratingAsset: AssetMediaResponseDto;
let facesAsset: AssetMediaResponseDto;

const setupTests = async () => {
await utils.resetDatabase();
Expand Down Expand Up @@ -224,6 +230,64 @@ describe('/asset', () => {
});
});

it('should get the asset faces', async () => {
const config = await getSystemConfig(admin.accessToken);
config.metadata.faces.import = true;
await updateConfig({ systemConfigDto: config }, { headers: asBearerAuth(admin.accessToken) });

// asset faces
facesAsset = await utils.createAsset(admin.accessToken, {
assetData: {
filename: 'portrait.jpg',
bytes: await readFile(facesAssetFilepath),
},
});

await utils.waitForWebsocketEvent({ event: 'assetUpload', id: facesAsset.id });

const { status, body } = await request(app)
.get(`/assets/${facesAsset.id}`)
.set('Authorization', `Bearer ${admin.accessToken}`);
expect(status).toBe(200);
expect(body.id).toEqual(facesAsset.id);
expect(body.people).toMatchObject([
{
name: 'Marie Curie',
birthDate: null,
thumbnailPath: '',
isHidden: false,
faces: [
{
imageHeight: 700,
imageWidth: 840,
boundingBoxX1: 261,
boundingBoxX2: 356,
boundingBoxY1: 146,
boundingBoxY2: 284,
sourceType: 'exif',
},
],
},
{
name: 'Pierre Curie',
birthDate: null,
thumbnailPath: '',
isHidden: false,
faces: [
{
imageHeight: 700,
imageWidth: 840,
boundingBoxX1: 536,
boundingBoxX2: 618,
boundingBoxY1: 83,
boundingBoxY2: 252,
sourceType: 'exif',
},
],
},
]);
});

it('should work with a shared link', async () => {
const sharedLink = await utils.createSharedLink(user1.accessToken, {
type: SharedLinkType.Individual,
Expand Down
1 change: 1 addition & 0 deletions e2e/src/api/specs/server-info.e2e-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ describe('/server-info', () => {
configFile: false,
duplicateDetection: false,
facialRecognition: false,
importFaces: false,
map: true,
reverseGeocoding: true,
oauth: false,
Expand Down
1 change: 1 addition & 0 deletions e2e/src/api/specs/server.e2e-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ describe('/server', () => {
facialRecognition: false,
map: true,
reverseGeocoding: true,
importFaces: false,
oauth: false,
oauthAutoLaunch: false,
passwordLogin: true,
Expand Down
2 changes: 1 addition & 1 deletion e2e/test-assets
bugfest marked this conversation as resolved.
Show resolved Hide resolved
4 changes: 4 additions & 0 deletions mobile/openapi/README.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions mobile/openapi/lib/api.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions mobile/openapi/lib/api_client.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions mobile/openapi/lib/api_helper.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

23 changes: 20 additions & 3 deletions mobile/openapi/lib/model/asset_face_response_dto.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading