Kang 02b29046b3
feat: ocr (#18836)
* feat: add OCR functionality and related configurations

* chore: update labeler configuration for machine learning files

* feat(i18n): enhance OCR model descriptions and add orientation classification and unwarping features

* chore: update Dockerfile to include ccache for improved build performance

* feat(ocr): enhance OCR model configuration with orientation classification and unwarping options, update PaddleOCR integration, and improve response structure

* refactor(ocr): remove OCR_CLEANUP job from enum and type definitions

* refactor(ocr): remove obsolete OCR entity and migration files, and update asset job status and schema to accommodate new OCR table structure

* refactor(ocr): update OCR schema and response structure to use individual coordinates instead of bounding box, and adjust related service and repository files

* feat: enhance OCR configuration and functionality

- Updated OCR settings to include minimum detection box score, minimum detection score, and minimum recognition score.
- Refactored PaddleOCRecognizer to utilize new scoring parameters.
- Introduced new database tables for asset OCR data and search functionality.
- Modified related services and repositories to support the new OCR features.
- Updated translations for improved clarity in settings UI.

* sql changes

* use rapidocr

* change dto

* update web

* update lock

* update api

* store positions as normalized floats

* match column order in db

* update admin ui settings descriptions

fix max resolution key

set min threshold to 0.1

fix bind

* apply config correctly, adjust defaults

* unnecessary model type

* unnecessary sources

* fix(ocr): switch RapidOCR lang type from LangDet to LangRec

* fix(ocr): expose lang_type (LangRec.CH) and font_path on OcrOptions for RapidOCR

* fix(ocr): make OCR text search case- and accent-insensitive using ILIKE + unaccent

* fix(ocr): add OCR search fields

* fix: Add OCR database migration and update ML prediction logic.

* trigrams are already case insensitive

* add tests

* format

* update migrations

* wrong uuid function

* linting

* maybe fix medium tests

* formatting

* fix weblate check

* openapi

* sql

* minor fixes

* maybe fix medium tests part 2

* passing medium tests

* format web

* readd sql

* format dart

* disabled in e2e

* chore: translation ordering

---------

Co-authored-by: mertalev <101130780+mertalev@users.noreply.github.com>
Co-authored-by: Alex Tran <alex.tran1502@gmail.com>
2025-10-27 14:09:55 +00:00
..
2025-10-27 14:09:55 +00:00
2025-10-27 14:09:55 +00:00

openapi

Immich API

This Dart package is automatically generated by the OpenAPI Generator project:

  • API version: 2.1.0
  • Generator version: 7.8.0
  • Build package: org.openapitools.codegen.languages.DartClientCodegen

Requirements

Dart 2.12 or later

Installation & Usage

Github

If this Dart package is published to Github, add the following dependency to your pubspec.yaml

dependencies:
  openapi:
    git: https://github.com/GIT_USER_ID/GIT_REPO_ID.git

Local

To use the package in your local drive, add the following dependency to your pubspec.yaml

dependencies:
  openapi:
    path: /path/to/openapi

Tests

TODO

Getting Started

Please follow the installation procedure and then run the following:

import 'package:openapi/api.dart';

// TODO Configure API key authorization: cookie
//defaultApiClient.getAuthentication<ApiKeyAuth>('cookie').apiKey = 'YOUR_API_KEY';
// uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//defaultApiClient.getAuthentication<ApiKeyAuth>('cookie').apiKeyPrefix = 'Bearer';
// TODO Configure API key authorization: api_key
//defaultApiClient.getAuthentication<ApiKeyAuth>('api_key').apiKey = 'YOUR_API_KEY';
// uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//defaultApiClient.getAuthentication<ApiKeyAuth>('api_key').apiKeyPrefix = 'Bearer';
// TODO Configure HTTP Bearer authorization: bearer
// Case 1. Use String Token
//defaultApiClient.getAuthentication<HttpBearerAuth>('bearer').setAccessToken('YOUR_ACCESS_TOKEN');
// Case 2. Use Function which generate token.
// String yourTokenGeneratorFunction() { ... }
//defaultApiClient.getAuthentication<HttpBearerAuth>('bearer').setAccessToken(yourTokenGeneratorFunction);

final api_instance = APIKeysApi();
final aPIKeyCreateDto = APIKeyCreateDto(); // APIKeyCreateDto | 

try {
    final result = api_instance.createApiKey(aPIKeyCreateDto);
    print(result);
} catch (e) {
    print('Exception when calling APIKeysApi->createApiKey: $e\n');
}

Documentation for API Endpoints

All URIs are relative to /api

Class Method HTTP request Description
APIKeysApi createApiKey POST /api-keys
APIKeysApi deleteApiKey DELETE /api-keys/{id}
APIKeysApi getApiKey GET /api-keys/{id}
APIKeysApi getApiKeys GET /api-keys
APIKeysApi getMyApiKey GET /api-keys/me
APIKeysApi updateApiKey PUT /api-keys/{id}
ActivitiesApi createActivity POST /activities
ActivitiesApi deleteActivity DELETE /activities/{id}
ActivitiesApi getActivities GET /activities
ActivitiesApi getActivityStatistics GET /activities/statistics
AlbumsApi addAssetsToAlbum PUT /albums/{id}/assets
AlbumsApi addAssetsToAlbums PUT /albums/assets
AlbumsApi addUsersToAlbum PUT /albums/{id}/users
AlbumsApi createAlbum POST /albums
AlbumsApi deleteAlbum DELETE /albums/{id}
AlbumsApi getAlbumInfo GET /albums/{id}
AlbumsApi getAlbumStatistics GET /albums/statistics
AlbumsApi getAllAlbums GET /albums
AlbumsApi removeAssetFromAlbum DELETE /albums/{id}/assets
AlbumsApi removeUserFromAlbum DELETE /albums/{id}/user/{userId}
AlbumsApi updateAlbumInfo PATCH /albums/{id}
AlbumsApi updateAlbumUser PUT /albums/{id}/user/{userId}
AssetsApi checkBulkUpload POST /assets/bulk-upload-check checkBulkUpload
AssetsApi checkExistingAssets POST /assets/exist checkExistingAssets
AssetsApi deleteAssetMetadata DELETE /assets/{id}/metadata/{key}
AssetsApi deleteAssets DELETE /assets
AssetsApi downloadAsset GET /assets/{id}/original
AssetsApi getAllUserAssetsByDeviceId GET /assets/device/{deviceId} getAllUserAssetsByDeviceId
AssetsApi getAssetInfo GET /assets/{id}
AssetsApi getAssetMetadata GET /assets/{id}/metadata
AssetsApi getAssetMetadataByKey GET /assets/{id}/metadata/{key}
AssetsApi getAssetStatistics GET /assets/statistics
AssetsApi getRandom GET /assets/random
AssetsApi playAssetVideo GET /assets/{id}/video/playback
AssetsApi replaceAsset PUT /assets/{id}/original Replace the asset with new file, without changing its id
AssetsApi runAssetJobs POST /assets/jobs
AssetsApi updateAsset PUT /assets/{id}
AssetsApi updateAssetMetadata PUT /assets/{id}/metadata
AssetsApi updateAssets PUT /assets
AssetsApi uploadAsset POST /assets
AssetsApi viewAsset GET /assets/{id}/thumbnail
AuthAdminApi unlinkAllOAuthAccountsAdmin POST /admin/auth/unlink-all
AuthenticationApi changePassword POST /auth/change-password
AuthenticationApi changePinCode PUT /auth/pin-code
AuthenticationApi getAuthStatus GET /auth/status
AuthenticationApi lockAuthSession POST /auth/session/lock
AuthenticationApi login POST /auth/login
AuthenticationApi logout POST /auth/logout
AuthenticationApi resetPinCode DELETE /auth/pin-code
AuthenticationApi setupPinCode POST /auth/pin-code
AuthenticationApi signUpAdmin POST /auth/admin-sign-up
AuthenticationApi unlockAuthSession POST /auth/session/unlock
AuthenticationApi validateAccessToken POST /auth/validateToken
DeprecatedApi createPartnerDeprecated POST /partners/{id}
DeprecatedApi getRandom GET /assets/random
DeprecatedApi replaceAsset PUT /assets/{id}/original Replace the asset with new file, without changing its id
DownloadApi downloadArchive POST /download/archive
DownloadApi getDownloadInfo POST /download/info
DuplicatesApi deleteDuplicate DELETE /duplicates/{id}
DuplicatesApi deleteDuplicates DELETE /duplicates
DuplicatesApi getAssetDuplicates GET /duplicates
FacesApi createFace POST /faces
FacesApi deleteFace DELETE /faces/{id}
FacesApi getFaces GET /faces
FacesApi reassignFacesById PUT /faces/{id}
JobsApi createJob POST /jobs
JobsApi getAllJobsStatus GET /jobs
JobsApi sendJobCommand PUT /jobs/{id}
LibrariesApi createLibrary POST /libraries
LibrariesApi deleteLibrary DELETE /libraries/{id}
LibrariesApi getAllLibraries GET /libraries
LibrariesApi getLibrary GET /libraries/{id}
LibrariesApi getLibraryStatistics GET /libraries/{id}/statistics
LibrariesApi scanLibrary POST /libraries/{id}/scan
LibrariesApi updateLibrary PUT /libraries/{id}
LibrariesApi validate POST /libraries/{id}/validate
MapApi getMapMarkers GET /map/markers
MapApi reverseGeocode GET /map/reverse-geocode
MemoriesApi addMemoryAssets PUT /memories/{id}/assets
MemoriesApi createMemory POST /memories
MemoriesApi deleteMemory DELETE /memories/{id}
MemoriesApi getMemory GET /memories/{id}
MemoriesApi memoriesStatistics GET /memories/statistics
MemoriesApi removeMemoryAssets DELETE /memories/{id}/assets
MemoriesApi searchMemories GET /memories
MemoriesApi updateMemory PUT /memories/{id}
NotificationsApi deleteNotification DELETE /notifications/{id}
NotificationsApi deleteNotifications DELETE /notifications
NotificationsApi getNotification GET /notifications/{id}
NotificationsApi getNotifications GET /notifications
NotificationsApi updateNotification PUT /notifications/{id}
NotificationsApi updateNotifications PUT /notifications
NotificationsAdminApi createNotification POST /admin/notifications
NotificationsAdminApi getNotificationTemplateAdmin POST /admin/notifications/templates/{name}
NotificationsAdminApi sendTestEmailAdmin POST /admin/notifications/test-email
OAuthApi finishOAuth POST /oauth/callback
OAuthApi linkOAuthAccount POST /oauth/link
OAuthApi redirectOAuthToMobile GET /oauth/mobile-redirect
OAuthApi startOAuth POST /oauth/authorize
OAuthApi unlinkOAuthAccount POST /oauth/unlink
PartnersApi createPartner POST /partners
PartnersApi createPartnerDeprecated POST /partners/{id}
PartnersApi getPartners GET /partners
PartnersApi removePartner DELETE /partners/{id}
PartnersApi updatePartner PUT /partners/{id}
PeopleApi createPerson POST /people
PeopleApi deletePeople DELETE /people
PeopleApi deletePerson DELETE /people/{id}
PeopleApi getAllPeople GET /people
PeopleApi getPerson GET /people/{id}
PeopleApi getPersonStatistics GET /people/{id}/statistics
PeopleApi getPersonThumbnail GET /people/{id}/thumbnail
PeopleApi mergePerson POST /people/{id}/merge
PeopleApi reassignFaces PUT /people/{id}/reassign
PeopleApi updatePeople PUT /people
PeopleApi updatePerson PUT /people/{id}
SearchApi getAssetsByCity GET /search/cities
SearchApi getExploreData GET /search/explore
SearchApi getSearchSuggestions GET /search/suggestions
SearchApi searchAssetStatistics POST /search/statistics
SearchApi searchAssets POST /search/metadata
SearchApi searchLargeAssets POST /search/large-assets
SearchApi searchPerson GET /search/person
SearchApi searchPlaces GET /search/places
SearchApi searchRandom POST /search/random
SearchApi searchSmart POST /search/smart
ServerApi deleteServerLicense DELETE /server/license
ServerApi getAboutInfo GET /server/about
ServerApi getApkLinks GET /server/apk-links
ServerApi getServerConfig GET /server/config
ServerApi getServerFeatures GET /server/features
ServerApi getServerLicense GET /server/license
ServerApi getServerStatistics GET /server/statistics
ServerApi getServerVersion GET /server/version
ServerApi getStorage GET /server/storage
ServerApi getSupportedMediaTypes GET /server/media-types
ServerApi getTheme GET /server/theme
ServerApi getVersionCheck GET /server/version-check
ServerApi getVersionHistory GET /server/version-history
ServerApi pingServer GET /server/ping
ServerApi setServerLicense PUT /server/license
SessionsApi createSession POST /sessions
SessionsApi deleteAllSessions DELETE /sessions
SessionsApi deleteSession DELETE /sessions/{id}
SessionsApi getSessions GET /sessions
SessionsApi lockSession POST /sessions/{id}/lock
SessionsApi updateSession PUT /sessions/{id}
SharedLinksApi addSharedLinkAssets PUT /shared-links/{id}/assets
SharedLinksApi createSharedLink POST /shared-links
SharedLinksApi getAllSharedLinks GET /shared-links
SharedLinksApi getMySharedLink GET /shared-links/me
SharedLinksApi getSharedLinkById GET /shared-links/{id}
SharedLinksApi removeSharedLink DELETE /shared-links/{id}
SharedLinksApi removeSharedLinkAssets DELETE /shared-links/{id}/assets
SharedLinksApi updateSharedLink PATCH /shared-links/{id}
StacksApi createStack POST /stacks
StacksApi deleteStack DELETE /stacks/{id}
StacksApi deleteStacks DELETE /stacks
StacksApi getStack GET /stacks/{id}
StacksApi removeAssetFromStack DELETE /stacks/{id}/assets/{assetId}
StacksApi searchStacks GET /stacks
StacksApi updateStack PUT /stacks/{id}
SyncApi deleteSyncAck DELETE /sync/ack
SyncApi getDeltaSync POST /sync/delta-sync
SyncApi getFullSyncForUser POST /sync/full-sync
SyncApi getSyncAck GET /sync/ack
SyncApi getSyncStream POST /sync/stream
SyncApi sendSyncAck POST /sync/ack
SystemConfigApi getConfig GET /system-config
SystemConfigApi getConfigDefaults GET /system-config/defaults
SystemConfigApi getStorageTemplateOptions GET /system-config/storage-template-options
SystemConfigApi updateConfig PUT /system-config
SystemMetadataApi getAdminOnboarding GET /system-metadata/admin-onboarding
SystemMetadataApi getReverseGeocodingState GET /system-metadata/reverse-geocoding-state
SystemMetadataApi getVersionCheckState GET /system-metadata/version-check-state
SystemMetadataApi updateAdminOnboarding POST /system-metadata/admin-onboarding
TagsApi bulkTagAssets PUT /tags/assets
TagsApi createTag POST /tags
TagsApi deleteTag DELETE /tags/{id}
TagsApi getAllTags GET /tags
TagsApi getTagById GET /tags/{id}
TagsApi tagAssets PUT /tags/{id}/assets
TagsApi untagAssets DELETE /tags/{id}/assets
TagsApi updateTag PUT /tags/{id}
TagsApi upsertTags PUT /tags
TimelineApi getTimeBucket GET /timeline/bucket
TimelineApi getTimeBuckets GET /timeline/buckets
TrashApi emptyTrash POST /trash/empty
TrashApi restoreAssets POST /trash/restore/assets
TrashApi restoreTrash POST /trash/restore
UsersApi createProfileImage POST /users/profile-image
UsersApi deleteProfileImage DELETE /users/profile-image
UsersApi deleteUserLicense DELETE /users/me/license
UsersApi deleteUserOnboarding DELETE /users/me/onboarding
UsersApi getMyPreferences GET /users/me/preferences
UsersApi getMyUser GET /users/me
UsersApi getProfileImage GET /users/{id}/profile-image
UsersApi getUser GET /users/{id}
UsersApi getUserLicense GET /users/me/license
UsersApi getUserOnboarding GET /users/me/onboarding
UsersApi searchUsers GET /users
UsersApi setUserLicense PUT /users/me/license
UsersApi setUserOnboarding PUT /users/me/onboarding
UsersApi updateMyPreferences PUT /users/me/preferences
UsersApi updateMyUser PUT /users/me
UsersAdminApi createUserAdmin POST /admin/users
UsersAdminApi deleteUserAdmin DELETE /admin/users/{id}
UsersAdminApi getUserAdmin GET /admin/users/{id}
UsersAdminApi getUserPreferencesAdmin GET /admin/users/{id}/preferences
UsersAdminApi getUserSessionsAdmin GET /admin/users/{id}/sessions
UsersAdminApi getUserStatisticsAdmin GET /admin/users/{id}/statistics
UsersAdminApi restoreUserAdmin POST /admin/users/{id}/restore
UsersAdminApi searchUsersAdmin GET /admin/users
UsersAdminApi updateUserAdmin PUT /admin/users/{id}
UsersAdminApi updateUserPreferencesAdmin PUT /admin/users/{id}/preferences
ViewApi getAssetsByOriginalPath GET /view/folder
ViewApi getUniqueOriginalPaths GET /view/folder/unique-paths

Documentation For Models

Documentation For Authorization

Authentication schemes defined for the API:

bearer

  • Type: HTTP Bearer authentication
  • Type: API key
  • API key parameter name: immich_access_token
  • Location:

api_key

  • Type: API key
  • API key parameter name: x-api-key
  • Location: HTTP header

Author