DeepARSDK / quickstart-ios-swift

DeepAR SDK for iOS example project
https://developer.deepar.ai
MIT License
23 stars 9 forks source link

[BUG] faceTracked(_ faceData: MultiFaceData) is always executed #15

Closed olegkhomenko closed 3 years ago

olegkhomenko commented 3 years ago

Hi,

If define faceTracked in ViewController in the default quickstart-ios-swift project

extension ViewController: DeepARDelegate {
    func faceTracked(_ faceData: MultiFaceData) {
        print("Face Tracked")
    }
}

This method is always executed, even if there is no person in the camera (see. screenshot) It looks like it's wrong behavior according to documentation:

... (void)faceTracked:(MultiFaceData)faceData Called on each frame where at least one face data is detected. ...

Screenshot example (faceTracked is executed on this frame)

JelenaKB commented 3 years ago

Thank you for bringing this to our attention. This is a documentation issue,(void)faceTracked:(MultiFaceData)faceData should be called whenever face tracking processes a frame, whether or not a face is visible. We will fix this in our docs.

If you need to know if a face is visible, you should check faceData[i].faceVisible for all faces, or use (void)faceVisiblityDidChange:(BOOL)faceVisible