Face landmark detection has staticImageMode option that seems to do nothing

tfjs-models/face-landmarks-detection/src/tfjs at master · tensorflow/tfjs-models · GitHub states:

staticImageMode: Optional. Defaults to false. If set to true, face detection will run on every input image, otherwise if set to false then detection runs once and then the model simply tracks those landmarks without invoking another detection until it loses track of any of the faces (ideal for videos).

How can detector.estimateFaces report multiple detections? It seems that the Android version of this relies upon an event listener to receive multiple detections. So does this work in TFJS? If it doesn’t work perhaps it shouldn’t be in the documentation.

Hi @Ken_Kahn ,

I apologize for the late response. As per my understanding, if staticImageMode is set to true. It will depose the next upcoming images even in the case of android events.

Check the following condition: Condition

if (allFaceDetections.length === 0) {
    this.reset();
    image3d.dispose();
    return [];
}

If there are already images in the queue and no face has been detected, it will discard the other images in the queue. So, even in the case of an Android event listener, it will also discard upcoming images.

Please let me know if I’ve missed anything.

Thank you!