---
title: "insertOrUpdateAssets(_:)"
framework: Media Intelligence
role: symbol
role_heading: Instance Method
platforms: [iOS 27.0+, iPadOS 27.0+, Mac Catalyst 27.0+, macOS 27.0+, tvOS 27.0+, visionOS 27.0+]
path: "mediaintelligence/facegroupanalyzer/insertorupdateassets(_:)"
---

# insertOrUpdateAssets(_:)

Adds or replaces image assets in the analyzer.

## Declaration

```swift
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

Detecting and grouping faces in images

## Return Value

Return Value An async sequence of (assetID, faces) pairs — one per asset — reporting the faces detected in each image.

## Discussion

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.

## See Also

### Managing assets

- [workingDirectory](mediaintelligence/facegroupanalyzer/workingdirectory.md)
- [deleteAssets(_:)](mediaintelligence/facegroupanalyzer/deleteassets(_:).md)
- [deleteAllAssets()](mediaintelligence/facegroupanalyzer/deleteallassets().md)
- [purge(workingDirectory:)](mediaintelligence/facegroupanalyzer/purge(workingdirectory:).md)
