Home

Awesome

Rembg Virtual Greenscreen Edition (Dr. Tim Scarfe)

Rembg Virtual Greenscreen Edition is a tool to create a green screen matte for videos

<p style="display: flex;align-items: center;justify-content: center;"> <img src="https://raw.githubusercontent.com/ecsplendid/rembg/master/examples/greenscreen.png" width="100%" /> </p>

Video Virtual Green Screen Edition

15th Jan 2021 -- made a new YouTube explainer

If you have any ideas for speeding this up further, please let us know. We have tried quite a few things at this stage and are a bit stuck on how to proceed from here. See some of the "evolution" in the Whimsical notes.

Usage;

pip install rembg-greenscreen

greenscreen -g "path/video.mp4"

Experimental parallel green screen version;

greenscreen --parallelgreenscreen "path/video.mp4" --workernodes 3 --gpubatchsize 5

The command above will produce a video.matte.mp4 in the same folder, also works with mov and avi extensions. Uses ffmpeg under the hood to stream and re-encode the frames into a grayscale matte video.

Be careful with the default parameters, my 11GB GPU is already pretty much maxed with 3 instances of the NN with 5 image gpu batches in forward pass.

You can see how much free GPU ram you have with

nvidia-smi

CLI interface

<p style="display: flex;align-items: center;justify-content: center;"> <img src="https://raw.githubusercontent.com/ecsplendid/rembg/master/examples/greenscreen_cli.png" width="65%" /> </p>

Important notes

References

License

Licensed under MIT License