This is an implementation of the mediapipe's face detection as a Cog model. Cog packages machine learning models as standard containers
It allows batch or individual face detection, and outputs a mask of the face position(s)
cog predict \
-i images=@path/to/file \
-i blur_amount=1.5 \
-i bias=0 \
-i output_transparent_image=true
or without cloning the git repo:
cog predict r8.im/chigozienri/mediapipe-face@latest \
-i images=@path/to/file \
-i blur_amount=0.0 \
-i bias=10 \
-i output_transparent_image=false
images
(required) can be a path to a png/jpg/jpeg, or zip/tar of multiple png/jpg/jpegblur_amount
is any float >= 0, the amount of blur applied to the edges of the maskbias
is an int between 0-255, how light the background of the mask should be (if you want to let some of the original background through)output_transparent_image
is a bool, outputs an RGBA of the original image with the mask on the alpha channel if true, or a grayscale image of the mask if false