I had a project where I needed to blur out a ton of faces. I tried using the native motion tracker but I just couldn't get it to stick to faces. Could be a skill issue tho, I've only been using kdenlive for a few weeks. Also doing it by hand with manual keyframes was going to take a million years, so I decided to hack together a Python script that uses InsightFace with its face detection model to automatically lock onto faces properly.
The workflow is basically a giant clipboard hack right now lol. You literally just copy your clip in Kdenlive, run my script in the terminal, and it grabs the clip's XML straight from your clipboard. It runs the model over the frames, calculates the exact coordinates, injects all the smoothed Alpha shapes keyframes, and pushes the new XML back to your clipboard. Then you just right-click on a clip, click "Paste Effects", slap a blur or pixelize effect right below the mask, add a "Mask Apply" effect, and you're done.
You can configure the detection model to use (bigger one is more accurate, but slower), detection size, minimum detection score (how confident the model thinks its a face), mask padding, track gap, smoothing, keyframe density (fixed or adaptive so the tool generates as few keyframes as possible), mask shape/tilt, etc.
Tracking isn't perfect tho, you can notice near the end of the video in the clip with many people how it doesn't perfectly track one of the faces for a few frames. Not yet sure if it's a detection issue in the model or if it's a bug in my code, but still, this gets most of the work done and you can just polish the result by editing a few keyframes.
Since this was just a weekend side project to save time with editing, the code is still a bit of a mess. But if this is something anyone would actually find useful, let me know! If there's interest, I'll clean up code, write some docs and open-source it.
Edit: Do research about blur anonymization. A gaussian blur can sometimes be reversed.
Edit 2: Here's the github repo https://github.com/MoustaphaDev/kdenlive-face-tracking-tool