ORB-HD / deface

Video anonymization by face detection
MIT License
660 stars 93 forks source link

Increase/decrease scores by a mask image #9

Open OndraZizka opened 3 years ago

OndraZizka commented 3 years ago

Sometimes, the video contains false positives popping in and out, in a scene which is otherwise not changing.

Other part of the scene is changing, and contains false negatives.

It would be nice if this scene separation could be hinted to deface in a form of a grayscale mask, where black would decrease the score of a face detected on that coordinate, and white would increase.

mdraw commented 3 years ago

That's a good idea in theory, but I'm not sure how this should be implemented in practice in a generally useful way. A static grayscale mask would only be useful for videos where the camera location is fixed throughout the video. A "mask video" on the other hand (for dynamic scenes) would be harder to create and would require more code to be handled properly.

For the first case, I could imagine some option like $ deface video.mp4 --region-mask=mask.png where mask.png (same shape as video.mp4) contains the prior probabilities of detecting a face at each pixel location in video.mp4. Would you like to implement this or is this just a feature suggestion?

OndraZizka commented 3 years ago

For the first case, I could imagine some option like $ deface video.mp4 --region-mask=mask.png where mask.png (same shape as video.mp4) contains the prior probabilities of detecting a face at each pixel location in video.mp4. Would you like to implement this or is this just a feature suggestion?

Yes, that is exactly what I had in mind. Yes, it is only useful for a static camera, but that is surprisingly many use cases - timelapses, weather cameras, cameras on a tripod, etc.