Konecz

How do you cut out a person or remove a photo's background in an AI video?

Article by

To cut a person out of a video, Konecz uses MediaPipe Selfie Multiclass, a small model that separates the person from the background frame by frame. To remove the background from a real photo (a product, a person, an object), it uses BiRefNet. Both are openly licensed and run on our own server, so the image never leaves it.

What is cutting out the person for?

It lets you change the background without touching the person. The most common case here is a blurred background: the presenter stays sharp, the set behind goes soft, and text and graphics get a clean place to sit.

In the Santa videos, the presenter was generated in HeyGen. The take came with a background that fought with the edit. Instead of generating it again (and paying again), MediaPipe found the person in each frame and the background was blurred underneath. The paid take was used in full.

Which model does what?

There are three different jobs, each with its own tool:

Job Model License Where it is used
Separate the person from the background in video MediaPipe Selfie Multiclass (256 × 256) Apache 2.0 blurred background in presenter takes
Remove a photo's background BiRefNet general, through rembg MIT real photos placed in the video
Find the face YuNet open checking that no text covers the face

The last row trips a lot of people up. Cutting out the person is not the same as knowing where the face is. To make sure a caption never lands on someone's mouth, Kodecz uses YuNet, which returns only the face box. For that question it is lighter and more precise than a full-body cutout.

Why does MediaPipe work on such a small image?

Because it does not need more. The model sees the frame at 256 × 256 pixels and returns a mask: what is person, what is background. The mask is scaled up to the video size. To blur a background, a soft edge is enough, and nobody sees the difference. The speed gain adds up over the thousands of frames in a video.

And when does BiRefNet come in?

When the video uses a real photo. A dish, a bottle, a client's finished project. BiRefNet removes the background with a fine edge (hair, a strap, the rim of a glass), and the cut piece can float over the animation, slide in from the side, get a shadow.

It is called through rembg, a tool that downloads the model the first time. On our server, the model lives in one folder with all the others instead of scattered across caches. That way we know what is installed and can delete what is no longer used.

Why only openly licensed models?

Because the videos are sold. The Konecz rule is to accept only Apache 2.0, MIT, BSD, CC0 or equivalent models. Several good models were left out for that reason:

  1. Wav2Lip: non-commercial use only.
  2. The InsightFace models: non-commercial use only.
  3. The original Gaussian splatting code (Inria): non-commercial use only.

A model can shine in a test and still be unusable. Checking the license before testing saves redoing the work later.

Why run it on our own server?

Three practical reasons:

On 19/11/2026, the Konecz portfolio had 108 videos: 57 in 2D, 48 realistic and 3 in 3D. The realistic ones need cutouts most, because they mix a person, a set and text on the same screen.

Frequently asked questions

Can you remove the background of a whole video without a green screen? Yes. MediaPipe separates the person frame by frame. Replacing the background entirely needs a cleaner edge than just blurring it, so the result depends on the take.

Is the cutout done by an outside service? No. The models sit on the Konecz server and run there.

Does the model that cuts out the person also find the face? No. The face is found by YuNet, which keeps captions and text away from it.

Why not use the most famous model? Because many famous ones only allow non-commercial use. The license is checked before the test.

The videos Konecz posts every day go through these steps without the client recording anything. See examples in the portfolio or read how the engine turns a page into video at /en/blog/kodecz-render.

Markdown version