Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

247
Views
VNDetectFaceRectanglesRequest always returns 0 for yaw/pitch/roll

I'm trying to get the pitch / yaw / roll of a face in an image using the Vision framework but always get 0 for all values. Images should be very easy to process (mostly forward looking portraits).

I've successfully got these values by using Amazon Rekognition on them, so the images themselves aren't the issue. (I need to do a batch of about 70,000 so using rekogniton for them all will get expensive and slow.)

This is the request code:

let faceLandmarksRequest = VNDetectFaceRectanglesRequest(completionHandler: handleRectangles)

let requestHandler = VNImageRequestHandler(cgImage: cgImage!, orientation: CGImagePropertyOrientation.right ,options: [:])

do {
    try requestHandler.perform([faceLandmarksRequest])
} catch {
    print(error)
}

And here's the handler code:

func handleRectangles(request: VNRequest, errror: Error?) {

    guard let observations = request.results as? [VNFaceObservation] else {
        fatalError("unexpected result type!")
    }

    for face in observations {

        print("\(face.yaw))") // always zero

    }
}

Any help appreciated :)

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

Actually roll and yaw work, but for now they are very rough. You always get zero because roll and yaw (as of 2019) are a discrete set of 6 or 7 values rather than a continuous range of values with exact orientation of the face.

Try a "more rotated" face.

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!