mirror of
https://github.com/immich-app/immich.git
synced 2025-12-12 15:50:43 -08:00
feat: getAssetOcr endpoint (#23331)
* feat: getAssetOcr endpoint * pr feedback
This commit is contained in:
@@ -309,10 +309,44 @@ const assetSidecarWriteFactory = (asset: Partial<SidecarWriteAsset> = {}) => ({
|
||||
...asset,
|
||||
});
|
||||
|
||||
const assetOcrFactory = (
|
||||
ocr: {
|
||||
id?: string;
|
||||
assetId?: string;
|
||||
x1?: number;
|
||||
y1?: number;
|
||||
x2?: number;
|
||||
y2?: number;
|
||||
x3?: number;
|
||||
y3?: number;
|
||||
x4?: number;
|
||||
y4?: number;
|
||||
boxScore?: number;
|
||||
textScore?: number;
|
||||
text?: string;
|
||||
} = {},
|
||||
) => ({
|
||||
id: newUuid(),
|
||||
assetId: newUuid(),
|
||||
x1: 0.1,
|
||||
y1: 0.2,
|
||||
x2: 0.3,
|
||||
y2: 0.2,
|
||||
x3: 0.3,
|
||||
y3: 0.4,
|
||||
x4: 0.1,
|
||||
y4: 0.4,
|
||||
boxScore: 0.95,
|
||||
textScore: 0.92,
|
||||
text: 'Sample Text',
|
||||
...ocr,
|
||||
});
|
||||
|
||||
export const factory = {
|
||||
activity: activityFactory,
|
||||
apiKey: apiKeyFactory,
|
||||
asset: assetFactory,
|
||||
assetOcr: assetOcrFactory,
|
||||
auth: authFactory,
|
||||
authApiKey: authApiKeyFactory,
|
||||
authUser: authUserFactory,
|
||||
|
||||
Reference in New Issue
Block a user