5 ms·
YouTube-Style Face Detect – Crop and Blur Using Python and OpenCV
- KaiserPro 7y agonice work. If you have GPU power, I recommend using tinyfaces (https://www.cs.cmu.edu/~peiyunh/tiny/ https://www.cs.cmu.edu/~peiyunh/tiny/) as your face detector. But you won't get realtime performance... We used a similar model to detect and blur faces from raw user uploaded images at scale, using a multi-stage pipeline.
- willem19x 7y agonice work! I liked low on CPU since nowadays its hard to implement things without a GPU(DL) for things that involve to multiple crops/blur .
- snovv_crash 7y agoNice and clean. However, it looks like the blur has some (blue?) banding artifacts in it. Am I the only one who sees that?
- ihuman 7y agoI see it too. I wonder if it's including the blue border you see in one of the earlier debugging images.
- snovv_crash 7y agoHah, yes, I guess they're doing the blurring on the image with the box overlaid, instead of the original.
- cbhl 7y agoYes, I would also guess they're blurring the image with the box overlaid. In a production implementation, you may also want to consider how you do edge handling here. (For faces in the middle of the frame, you want to use the real pixels from the underlying source image? Do you want to extend the pixels from inside the border? What are the aesthetic and information theory implications of each technique?) https://en.wikipedia.org/wiki/Kernel_(image_processing)#Edge_Handling https://en.wikipedia.org/wiki/Kernel_(image_processing)#Edge...
- cbhl 7y agoIn my personal opinion, a naive gaussian blur could be susceptible to supersampling attacks, especially in a video where you can take samples over multiple frames. In a production implementation, I would consider adding some steps to mitigate this.
- aripickar 7y agoTheoretically, augmenting the blurred image with some sort of random, changing offset for the HSV values on each frame would prevent supersampling attacks, right?
- contravariant 7y agoAdding noise is definitely helps, but removing noise is more or less the main feature of supersampling. If you didn't have any noise you could just simply invert the Gaussian blur, as blurring is a reversible operation (in theory, in practice you have noise, hence the need for supersampling). Annoyingly it's hard to come up with a method that doesn't leak any information, although heavily pixelating the image (and optionally blurring the few leftover pixels) would probably make it infeasible to recover the original (except maybe with a truly stupendous amount of footage).
- poxrud 7y agoThey are using the haar cascade face detection, which works well for when the person is facing the camera straight ahead. Doesn't work great when the face is at an angle.