insertOrUpdateAssets(_:)
Adds or replaces image assets in the analyzer.
Declaration
final nonisolated(nonsending) func insertOrUpdateAssets(_ assets: [MediaIntelligenceImageAsset]) async throws -> some AsyncSequence<(assetID: MediaIntelligenceImageAsset.ID, faces: Array<FaceGroupAnalyzer.Face>), any Error>
Parameters
- assets:
The image assets to ingest.
Mentioned in
Return Value
An async sequence of (assetID, faces) pairs — one per asset — reporting the faces detected in each image.
Discussion
For each asset, the method detects faces and extracts facial data, then persists the results to the working directory. If an asset with the same identifier already exists, the method replaces its face data.
After this call, state becomes FaceGroupAnalyzer.State.stale until you call update(subprogress:). Faces detected in this call have a nil entityID until clustering runs.