rodgomesc / vision-camera-face-detector

VisionCamera Frame Processor Plugin to detect faces using MLKit Vision Face Detector
MIT License
95 stars 66 forks source link

In IOS face is not returning the countours and bounds #18

Open bilalattari opened 2 years ago

bilalattari commented 2 years ago

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}

blackPeanut commented 2 years ago

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

bilalattari commented 2 years ago

any update??

bilalattari commented 2 years ago

`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 commented 2 years ago
"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

fleuverouge commented 2 years ago

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.

bilalattari commented 2 years ago

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

It's not updated on the npm

fleuverouge commented 2 years ago

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 react-native-vision-camera@2.13.3

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)

DeepikaSharma5 commented 2 years ago

@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.

longnc100500 commented 1 year ago
"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