Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Pet Segmentation iOS View Controller with Fritz (
extension ViewController: AVCaptureVideoDataOutputSampleBufferDelegate {
func captureOutput(_ output: AVCaptureOutput, didOutput sampleBuffer: CMSampleBuffer, from connection: AVCaptureConnection) {
let image = FritzVisionImage(buffer: sampleBuffer)
image.metadata = FritzVisionImageMetadata()
image.metadata?.orientation = FritzImageOrientation(from: connection)
guard let result = try? visionModel.predict(image) else { return }
let mask = result.buildSingleClassMask(
resize: false,
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.