21.7 C
Canberra
Tuesday, October 21, 2025

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


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

However once I run the identical code on gadgets with iOS 26, the landmark coordinates are outdoors the [0,1] vary, which signifies they’re out of face bounds.

Enjoyable reality: the outdated VNDetectFaceLandmarksRequest API works very effectively with out encountering this problem

How I get face landmarks:

personal let faceRectangleRequest = DetectFaceRectanglesRequest(.revision3)
personal var faceLandmarksRequest = DetectFaceLandmarksRequest(.revision3)

func detectFaces(in ciImage: CIImage) async throws -> FaceTrackingResult {
    let faces = attempt await faceRectangleRequest.carry out(on: ciImage)
    faceLandmarksRequest.inputFaceObservations = faces
    let landmarksResults = attempt await faceLandmarksRequest.carry out(on: ciImage)
    ...
}

How I present face landmarks in SwiftUI View:

personal 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.0.1 -> at all times mistaken.
  • Examined a number of gadgets on iOS 18.7.1 -> at all times appropriate.

Setting:

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

Face Landmarks iOS 18

Imaginative and prescient face landmarks (DetectFaceLandmarksRequest) shifted on iOS 26 however appropriate on iOS 18 with similar 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

[td_block_social_counter facebook="tagdiv" twitter="tagdivofficial" youtube="tagdiv" style="style8 td-social-boxed td-social-font-icons" tdc_css="eyJhbGwiOnsibWFyZ2luLWJvdHRvbSI6IjM4IiwiZGlzcGxheSI6IiJ9LCJwb3J0cmFpdCI6eyJtYXJnaW4tYm90dG9tIjoiMzAiLCJkaXNwbGF5IjoiIn0sInBvcnRyYWl0X21heF93aWR0aCI6MTAxOCwicG9ydHJhaXRfbWluX3dpZHRoIjo3Njh9" custom_title="Stay Connected" block_template_id="td_block_template_8" f_header_font_family="712" f_header_font_transform="uppercase" f_header_font_weight="500" f_header_font_size="17" border_color="#dd3333"]
- Advertisement -spot_img

Latest Articles