mirror of
https://github.com/immich-app/immich
synced 2025-11-14 17:36:12 +00:00
feat(server): CLIP search integration (#1939)
This commit is contained in:
parent
0d436db3ea
commit
f56eaae019
46 changed files with 673 additions and 773 deletions
|
|
@ -1,10 +1,9 @@
|
|||
import {
|
||||
AssetService,
|
||||
IAlbumJob,
|
||||
IAssetJob,
|
||||
IAssetUploadedJob,
|
||||
IBulkEntityJob,
|
||||
IDeleteFilesJob,
|
||||
IDeleteJob,
|
||||
IUserDeletionJob,
|
||||
JobName,
|
||||
MediaService,
|
||||
|
|
@ -53,15 +52,20 @@ export class BackgroundTaskProcessor {
|
|||
export class MachineLearningProcessor {
|
||||
constructor(private smartInfoService: SmartInfoService) {}
|
||||
|
||||
@Process({ name: JobName.IMAGE_TAGGING, concurrency: 2 })
|
||||
@Process({ name: JobName.IMAGE_TAGGING, concurrency: 1 })
|
||||
async onTagImage(job: Job<IAssetJob>) {
|
||||
await this.smartInfoService.handleTagImage(job.data);
|
||||
}
|
||||
|
||||
@Process({ name: JobName.OBJECT_DETECTION, concurrency: 2 })
|
||||
@Process({ name: JobName.OBJECT_DETECTION, concurrency: 1 })
|
||||
async onDetectObject(job: Job<IAssetJob>) {
|
||||
await this.smartInfoService.handleDetectObjects(job.data);
|
||||
}
|
||||
|
||||
@Process({ name: JobName.ENCODE_CLIP, concurrency: 1 })
|
||||
async onEncodeClip(job: Job<IAssetJob>) {
|
||||
await this.smartInfoService.handleEncodeClip(job.data);
|
||||
}
|
||||
}
|
||||
|
||||
@Processor(QueueName.SEARCH)
|
||||
|
|
@ -79,23 +83,23 @@ export class SearchIndexProcessor {
|
|||
}
|
||||
|
||||
@Process(JobName.SEARCH_INDEX_ALBUM)
|
||||
async onIndexAlbum(job: Job<IAlbumJob>) {
|
||||
await this.searchService.handleIndexAlbum(job.data);
|
||||
onIndexAlbum(job: Job<IBulkEntityJob>) {
|
||||
this.searchService.handleIndexAlbum(job.data);
|
||||
}
|
||||
|
||||
@Process(JobName.SEARCH_INDEX_ASSET)
|
||||
async onIndexAsset(job: Job<IAssetJob>) {
|
||||
await this.searchService.handleIndexAsset(job.data);
|
||||
onIndexAsset(job: Job<IBulkEntityJob>) {
|
||||
this.searchService.handleIndexAsset(job.data);
|
||||
}
|
||||
|
||||
@Process(JobName.SEARCH_REMOVE_ALBUM)
|
||||
async onRemoveAlbum(job: Job<IDeleteJob>) {
|
||||
await this.searchService.handleRemoveAlbum(job.data);
|
||||
onRemoveAlbum(job: Job<IBulkEntityJob>) {
|
||||
this.searchService.handleRemoveAlbum(job.data);
|
||||
}
|
||||
|
||||
@Process(JobName.SEARCH_REMOVE_ASSET)
|
||||
async onRemoveAsset(job: Job<IDeleteJob>) {
|
||||
await this.searchService.handleRemoveAsset(job.data);
|
||||
onRemoveAsset(job: Job<IBulkEntityJob>) {
|
||||
this.searchService.handleRemoveAsset(job.data);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue