---
title: FaceGroupAnalyzer
framework: Media Intelligence
role: symbol
role_heading: Class
platforms: [iOS 27.0+, iPadOS 27.0+, Mac Catalyst 27.0+, macOS 27.0+, tvOS 27.0+, visionOS 27.0+]
path: mediaintelligence/facegroupanalyzer
---

# FaceGroupAnalyzer

An object that detects faces in images and groups them by person.

## Declaration

```swift
final class FaceGroupAnalyzer
```

## Mentioned in

Detecting and grouping faces in images

## Overview

Overview FaceGroupAnalyzer is the central object in the face analysis pipeline. It detects faces in images, stores their data persistently in a working directory you choose, and clusters the faces into groups called entities, where each entity represents a distinct person. The analyzer stores all face data and cluster assignments in the directory you pass to init(workingDirectory:). This directory persists between app launches, so subsequent runs resume from where the previous session ended. Call purge(workingDirectory:) to remove all data from the directory. Use identifyFaces(in:) to detect and match faces in images without storing anything. This is useful for recognizing people in new images against an existing gallery without modifying the analyzer’s data.

## Topics

### Creating an analyzer

- [init(workingDirectory:)](mediaintelligence/facegroupanalyzer/init(workingdirectory:).md)

### Managing assets

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

### Updating the gallery

- [state](mediaintelligence/facegroupanalyzer/state-swift.property.md)
- [FaceGroupAnalyzer.State](mediaintelligence/facegroupanalyzer/state-swift.enum.md)
- [update(subprogress:)](mediaintelligence/facegroupanalyzer/update(subprogress:).md)

### Retrieving faces and entities

- [allFaces](mediaintelligence/facegroupanalyzer/allfaces.md)
- [allFacesByEntityID](mediaintelligence/facegroupanalyzer/allfacesbyentityid.md)
- [allEntities](mediaintelligence/facegroupanalyzer/allentities.md)
- [allAssetIDs](mediaintelligence/facegroupanalyzer/allassetids.md)
- [allAssetIDsByEntityID](mediaintelligence/facegroupanalyzer/allassetidsbyentityid.md)
- [FaceGroupAnalyzer.Face](mediaintelligence/facegroupanalyzer/face.md)
- [FaceGroupAnalyzer.Entity](mediaintelligence/facegroupanalyzer/entity.md)

### Fetching and identifying faces

- [fetchFaces(_:)](mediaintelligence/facegroupanalyzer/fetchfaces(_:).md)
- [fetchFaces(for:)](mediaintelligence/facegroupanalyzer/fetchfaces(for:).md)
- [fetchFaces(in:)](mediaintelligence/facegroupanalyzer/fetchfaces(in:).md)
- [fetchAssetIDs(for:)](mediaintelligence/facegroupanalyzer/fetchassetids(for:).md)
- [identifyFaces(in:)](mediaintelligence/facegroupanalyzer/identifyfaces(in:).md)

## Relationships

### Conforms To

- [Sendable](swift/sendable.md)
- [SendableMetatype](swift/sendablemetatype.md)

## See Also

### Image analysis

- [Detecting and grouping faces in images](mediaintelligence/detecting-and-grouping-faces-in-images.md)
- [MediaIntelligenceImageAsset](mediaintelligence/mediaintelligenceimageasset.md)
