HomeiOS DevelopmentImaginative and prescient face landmarks (DetectFaceLandmarksRequest) shifted on iOS 26 however right...

Imaginative and prescient face landmarks (DetectFaceLandmarksRequest) shifted on iOS 26 however right on iOS 18 with identical code and picture


I am utilizing Imaginative and prescient framework (VNDetectFaceLandmarksRequest) with the identical code and the identical take a look at picture to detect face landmarks. On iOS 18 every part works as anticipated: detected face landmarks align with the face accurately.

However after I run the identical code on gadgets with iOS 26, the landmarks are fully off – coordinates are shifted outdoors the detected face bounds.

How I get face landmarks:

non-public let faceRectangleRequest = DetectFaceRectanglesRequest(.revision3)
non-public var faceLandmarksRequest = DetectFaceLandmarksRequest(.revision3)

func detectFaces(in ciImage: CIImage) async throws -> FaceTrackingResult {
    strive await performFaceDetection(ciImage: ciImage)
}

non-public func performFaceDetection(ciImage: CIImage) async throws -> FaceTrackingResult {
    let faces = strive await faceRectangleRequest.carry out(on: ciImage)
    faceLandmarksRequest.inputFaceObservations = faces
    let landmarksResults = strive await faceLandmarksRequest.carry out(on: ciImage)
    ...
}

How I present face landmarks in SwiftUI View:

non-public func convert(
    level: NormalizedPoint,
    faceBoundingBox: NormalizedRect,
    imageSize: CGSize
) -> CGPoint {
    let level = level.toImageCoordinates(
        from: faceBoundingBox,
        imageSize: imageSize,
        origin: .upperLeft
    )

    return level
}

Issues I’ve already tried:

  • Similar picture enter
  • Examined a number of gadgets on iOS 26 -> all the time improper.
  • Examined a number of gadgets on iOS 18 -> all the time right.

Atmosphere:

  • macOS 26.0.1
  • Xcode 26.0 (17A324)
  • Actual gadgets, not simulator

Face Landmarks iOS 18

Imaginative and prescient face landmarks (DetectFaceLandmarksRequest) shifted on iOS 26 however right on iOS 18 with identical code and picture

Face Landmarks iOS 26

Face Landmarks iOS 26

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -
Google search engine

Most Popular

Recent Comments