Face Anonymizer Video

FACE_ANONYMIZER_VIDEO

Finds every face in a short video and covers it on each frame with a blur, pixelation or a solid box.

Video Editingprivacyface-blurvideomit
Face Anonymizer Video: Video Editing model on Kainguru

About Face Anonymizer Video

Finds every face in a short video and covers it on each frame. The cover is a blur, a pixelation, or a solid box. Faces stay covered for a few frames after the detector last saw them, so a blink does not uncover them.

Weights

The detector is YuNet, file face_detection_yunet_2023mar.onnx (about 230 KB), from the OpenCV Zoo at commit f12e12798e8314f7c074a6656816c048dcc95b7a.

Model card:

https://github.com/opencv/opencv_zoo/blob/f12e12798e8314f7c074a6656816c048dcc95b7a/models/face_detection_yunet/README.md

YuNet was trained by Shiqi Yu in libfacedetection (https://github.com/ShiqiYu/libfacedetection). Copyright 2020 Shiqi Yu. The OpenCV Zoo repository root is Apache-2.0. The YuNet model card on that commit states the files in the YuNet directory are under the MIT licence, and that is the licence for this weight file.

The file is public. An anonymous request for the bytes returns HTTP 200.

Limits

The request is rejected when the file is over 50 MB, when the container is not MP4, MOV or WebM, when either side is over 1920 pixels, when the clip is over 60 seconds or 1800 frames, when the file is not a readable colour video, or when method, strength, score_threshold or margin is outside the bounds above.

Faces are located on a copy whose longest side is at most 960 pixels, and the boxes are mapped back to the original frame. A face that was detected stays covered for three further frames after its last detection. YuNet was trained for faces of about 10 by 10 to 300 by 300 pixels on the image it scores, so a very small face can be missed. Profile faces, covered faces, drawings and non-human faces are outside what this detector is for.

Covering a box is not a promise that a person can no longer be recognised. The background, clothing, and any face the detector skipped stay visible. The output file has no audio track. The model runs on CPU.

Face Anonymizer Video inputs and output

NameTypeRequiredDefaultDetails
videofileYes—Video to anonymise. MP4, MOV or WebM, at most 50 MB, 60 seconds, 1800 frames and 1920 pixels on a side.
video/mp4
methodtextNoblurHow to cover each face: blur, pixelate or box.
Allowed: blur, pixelate, box
strengthintegerNo25Blur radius, or the pixel-block size when method is pixelate.
5–99
score_thresholdnumberNo0.6Minimum detector score for a box to count as a face.
0.3–0.99
marginnumberNo0.25Extra box size as a fraction of the face box, added on each side.
0–1

Output. Returns binary file.

Run Face Anonymizer Video with the API

Send your API key in the X-API-Key header. The run is asynchronous: submit it, then poll it until it finishes. Create an API key.

cURL
curl -X POST "https://api.kainguru.com/api/v1/executions?mlFlowId=FACE_ANONYMIZER_VIDEO" \
  -H "X-API-Key: kg_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
  "input": {
    "video": "https://example.com/input.png",
    "margin": 0.25,
    "method": "blur",
    "score_threshold": 0.6,
    "strength": 25
  },
  "outputFormat": "json"
}'

# Poll until the execution reaches a terminal state
curl "https://api.kainguru.com/api/v1/executions/{executionId}" \
  -H "X-API-Key: kg_your_api_key"
Python
from kainguru import KainguruClient

with KainguruClient(api_key="kg_your_api_key", base_url="https://api.kainguru.com/api") as client:
    submitted = client.executions.execute(
        "FACE_ANONYMIZER_VIDEO",
        {
          "video": "https://example.com/input.png",
          "margin": 0.25,
          "method": "blur",
          "score_threshold": 0.6,
          "strength": 25
        },
        output_format="json",
    )
    result = client.executions.await_completion(submitted.id)
    print(result.execution.output)

Face Anonymizer Video pricing

Price per request: 2.16 credits ($0.0216). The price is shown again before every run; all prices are on the pricing page.

Licence and source

Background Matting v2: Video Editing model on Kainguru
Video Editing

Background Matting v2

Cuts a person out of video precisely, hair included, when you also give a picture of the empty background from the…

Fine-tunable
DeOldify Video: Video Editing model on Kainguru
Video Editing

DeOldify Video

Colourises black-and-white video with DeOldify's video model: plausible colour for every frame, laid over the original…

Fine-tunable
MuseTalk 1.5: Video Editing model on Kainguru
Video Editing

MuseTalk 1.5

Makes a face in a video say new words. Send a clip of one talking face and an audio file; the mouth and jaw move to…

Fine-tunable
RIFE 4.26: Video Editing model on Kainguru
Video Editing

RIFE 4.26

Raises a video's frame rate 2, 3, 4 or 8 times by predicting the frames in between, fast enough for long clips (RIFE…

Fine-tunable
STTN Subtitle Remover: Video Editing model on Kainguru
Video Editing

STTN Subtitle Remover

Removes burned-in subtitles and captions from a video: finds the text on every frame and fills it in from the rest of…

Fine-tunable
Smart Crop Vertical: Video Editing model on Kainguru
Video Editing

Smart Crop Vertical

Turns a landscape clip into a 9:16 vertical clip whose window follows the largest face.