This project improves video background replacement by:
- Reducing Memory Usage: Processes videos in chunks instead of storing all frames in memory.
- Increasing Efficiency: Uses multiple CPU cores to speed up processing.
This is an enhancement over the method used in the Hugging Face Background-Remove space, which loads the entire video into memory.
Simply run the script with your input video, background image, and output paths.
apply_background(input_path, output_path, background_path)
pip install -r requirements.txt