feat(web): manual face tagging and deletion (#16062)

This commit is contained in:
Alex 2025-02-21 09:58:25 -06:00 committed by GitHub
parent 94c0e8253a
commit 007eaaceb9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
35 changed files with 2054 additions and 106 deletions

View file

@ -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": {

View file

@ -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;