mirror of
https://github.com/immich-app/immich
synced 2025-11-14 17:36:12 +00:00
feat(web): manual face tagging and deletion (#16062)
This commit is contained in:
parent
94c0e8253a
commit
007eaaceb9
35 changed files with 2054 additions and 106 deletions
|
|
@ -2428,9 +2428,85 @@
|
|||
"tags": [
|
||||
"Faces"
|
||||
]
|
||||
},
|
||||
"post": {
|
||||
"operationId": "createFace",
|
||||
"parameters": [],
|
||||
"requestBody": {
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/AssetFaceCreateDto"
|
||||
}
|
||||
}
|
||||
},
|
||||
"required": true
|
||||
},
|
||||
"responses": {
|
||||
"201": {
|
||||
"description": ""
|
||||
}
|
||||
},
|
||||
"security": [
|
||||
{
|
||||
"bearer": []
|
||||
},
|
||||
{
|
||||
"cookie": []
|
||||
},
|
||||
{
|
||||
"api_key": []
|
||||
}
|
||||
],
|
||||
"tags": [
|
||||
"Faces"
|
||||
]
|
||||
}
|
||||
},
|
||||
"/faces/{id}": {
|
||||
"delete": {
|
||||
"operationId": "deleteFace",
|
||||
"parameters": [
|
||||
{
|
||||
"name": "id",
|
||||
"required": true,
|
||||
"in": "path",
|
||||
"schema": {
|
||||
"format": "uuid",
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
],
|
||||
"requestBody": {
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/AssetFaceDeleteDto"
|
||||
}
|
||||
}
|
||||
},
|
||||
"required": true
|
||||
},
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": ""
|
||||
}
|
||||
},
|
||||
"security": [
|
||||
{
|
||||
"bearer": []
|
||||
},
|
||||
{
|
||||
"cookie": []
|
||||
},
|
||||
{
|
||||
"api_key": []
|
||||
}
|
||||
],
|
||||
"tags": [
|
||||
"Faces"
|
||||
]
|
||||
},
|
||||
"put": {
|
||||
"operationId": "reassignFacesById",
|
||||
"parameters": [
|
||||
|
|
@ -8172,6 +8248,58 @@
|
|||
],
|
||||
"type": "object"
|
||||
},
|
||||
"AssetFaceCreateDto": {
|
||||
"properties": {
|
||||
"assetId": {
|
||||
"format": "uuid",
|
||||
"type": "string"
|
||||
},
|
||||
"height": {
|
||||
"type": "integer"
|
||||
},
|
||||
"imageHeight": {
|
||||
"type": "integer"
|
||||
},
|
||||
"imageWidth": {
|
||||
"type": "integer"
|
||||
},
|
||||
"personId": {
|
||||
"format": "uuid",
|
||||
"type": "string"
|
||||
},
|
||||
"width": {
|
||||
"type": "integer"
|
||||
},
|
||||
"x": {
|
||||
"type": "integer"
|
||||
},
|
||||
"y": {
|
||||
"type": "integer"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"assetId",
|
||||
"height",
|
||||
"imageHeight",
|
||||
"imageWidth",
|
||||
"personId",
|
||||
"width",
|
||||
"x",
|
||||
"y"
|
||||
],
|
||||
"type": "object"
|
||||
},
|
||||
"AssetFaceDeleteDto": {
|
||||
"properties": {
|
||||
"force": {
|
||||
"type": "boolean"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"force"
|
||||
],
|
||||
"type": "object"
|
||||
},
|
||||
"AssetFaceResponseDto": {
|
||||
"properties": {
|
||||
"boundingBoxX1": {
|
||||
|
|
|
|||
|
|
@ -523,6 +523,19 @@ export type AssetFaceResponseDto = {
|
|||
person: (PersonResponseDto) | null;
|
||||
sourceType?: SourceType;
|
||||
};
|
||||
export type AssetFaceCreateDto = {
|
||||
assetId: string;
|
||||
height: number;
|
||||
imageHeight: number;
|
||||
imageWidth: number;
|
||||
personId: string;
|
||||
width: number;
|
||||
x: number;
|
||||
y: number;
|
||||
};
|
||||
export type AssetFaceDeleteDto = {
|
||||
force: boolean;
|
||||
};
|
||||
export type FaceDto = {
|
||||
id: string;
|
||||
};
|
||||
|
|
@ -2029,6 +2042,25 @@ export function getFaces({ id }: {
|
|||
...opts
|
||||
}));
|
||||
}
|
||||
export function createFace({ assetFaceCreateDto }: {
|
||||
assetFaceCreateDto: AssetFaceCreateDto;
|
||||
}, opts?: Oazapfts.RequestOpts) {
|
||||
return oazapfts.ok(oazapfts.fetchText("/faces", oazapfts.json({
|
||||
...opts,
|
||||
method: "POST",
|
||||
body: assetFaceCreateDto
|
||||
})));
|
||||
}
|
||||
export function deleteFace({ id, assetFaceDeleteDto }: {
|
||||
id: string;
|
||||
assetFaceDeleteDto: AssetFaceDeleteDto;
|
||||
}, opts?: Oazapfts.RequestOpts) {
|
||||
return oazapfts.ok(oazapfts.fetchText(`/faces/${encodeURIComponent(id)}`, oazapfts.json({
|
||||
...opts,
|
||||
method: "DELETE",
|
||||
body: assetFaceDeleteDto
|
||||
})));
|
||||
}
|
||||
export function reassignFacesById({ id, faceDto }: {
|
||||
id: string;
|
||||
faceDto: FaceDto;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue