Skip to content

Instantly share code, notes, and snippets.

@jacobsapps
Created April 6, 2026 12:38
Show Gist options
  • Select an option

  • Save jacobsapps/5f15c0d72033648e042e8c15a87ed534 to your computer and use it in GitHub Desktop.

Select an option

Save jacobsapps/5f15c0d72033648e042e8c15a87ed534 to your computer and use it in GitHub Desktop.
Quality Filter from Apple Photos, Face Tagging, and Embeddings
let qualityFaces = faces.filter { observation in
let faceWidth = observation.boundingBox.width * CGFloat(cgImage.width)
let faceHeight = observation.boundingBox.height * CGFloat(cgImage.height)
return faceWidth >= 40 && faceHeight >= 40 && observation.confidence >= 0.5
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment