vision-camera-face-detector icon indicating copy to clipboard operation
vision-camera-face-detector copied to clipboard

In IOS face is not returning the countours and bounds

Open bilalattari opened this issue 2 years ago • 10 comments

I am getting this in the response {"bounds": {}, "cotours": {}, "leftEyeOpenProbability": 0.9893174171447754, "pitchAngle": 7.884413242340088, "rightEyeOpenProbability": 0.8695240020751953, "rollAngle": 0.5081395506858826, "smilingProbability": 0.026149364188313484, "yawAngle": 8.621944427490234}

bilalattari avatar May 06 '22 14:05 bilalattari

I'm having the same issue. @rodgomesc Mate, do you know what might be the issue?

blackPeanut avatar May 10 '22 21:05 blackPeanut

any update??

bilalattari avatar May 15 '22 12:05 bilalattari

`static var faceDetector = FaceDetector.faceDetector(options: FaceDetectorOption)

private static func processContours(from faces: [Face]?) -> [String:CGFloat] {
// TODO: implement face contour calculations
return [:]

}

private static func processBoundingBox(from faces: [Face]?) -> [String:CGFloat] {
// TODO: implement bounding box calculations
return [:]

}`

IOS work is not done till yet.

bilalattari avatar May 17 '22 13:05 bilalattari

"vision-camera-face-detector": "https://github.com/rodgomesc/vision-camera-face-detector#master"

you need to install it like this to get the contours and bonds on IOS

bilalattari avatar May 18 '22 10:05 bilalattari

With @bilalattari 's solution I got the bounds, but the contours are empty (checked the face.contours array in the Swift code). Not sure if it's a bug of MLKit's or Vision Camera's.

fleuverouge avatar Jun 15 '22 08:06 fleuverouge

You can clone a master branch and you can get the countours and bonds from there.

It's not updated on the npm

bilalattari avatar Jun 15 '22 08:06 bilalattari

Hi @bilalattari Thanks for replying I found the content of VisionCameraFaceDetector.swift on my side is the same to https://github.com/rodgomesc/vision-camera-face-detector/blob/master/ios/VisionCameraFaceDetector.swift

I got the bounds with the same width and height every time, and no contours:

{"yawAngle":8.613482475280762,"bounds":{"height":688,"boundingCenterY":976,"width":688,"y":776,"boundingCenterX":608,"rawX":264,"rawY":632,"x":304},"rightEyeOpenProbability":0.998600959777832,"leftEyeOpenProbability":0.9882580041885376,"smilingProbability":0.4470736086368561,"rollAngle":-4.6768927574157715,"contours":{},"pitchAngle":3.3016912937164307}

In my package.json: "vision-camera-face-detector": "https://github.com/rodgomesc/vision-camera-face-detector#master"

Device: iPhone 6S - iOS 13.6 [email protected]

I tested the sample app from Google Samples (https://github.com/googlesamples/mlkit/tree/master/ios/quickstarts/vision) and the functions work normally (correct contours & bounds, ie face.frame)

fleuverouge avatar Jun 15 '22 09:06 fleuverouge

@rodgomesc @iAmGhost @didithilmy @donsn Can you please update your package with latest changes and bug fixes. Its been more than a year. It is not safe to direactly point to master branch which is dangerous as it reduces stability in development.

Hope you will update it soon.

DeepikaSharma5 avatar Aug 31 '22 17:08 DeepikaSharma5

"vision-camera-face-detector": "https://github.com/rodgomesc/vision-camera-face-detector#master"

you need to install it like this to get the contours and bonds on IOS

thanks! you save my day

longnc100500 avatar May 04 '23 08:05 longnc100500