MaskOn is a two-part project for instant, privacy-friendly video background removal, powered by deep learning and modern web technologies.
- Framework: TensorFlow / Keras
- Architecture: U-Net with ResNet-50 encoder
- Dataset: COCO 2017 (trained on the "person" category)
- Features:
- Custom data pipeline using
pycocotools - Data augmentation (horizontal flip)
- Loss: Combined BCE, Dice, Edge, and Tversky losses
- Metrics: Dice coefficient, IoU
- Model exported to ONNX for browser inference
- Custom data pipeline using
Training Notebook:
See model-training/model-trainer.ipynb for full code and details.
- Framework: React
- Libraries: onnxruntime-web, @ffmpeg/ffmpeg, Tailwind CSS
- Features:
- All processing runs locally in your browser (no uploads, privacy-first)
- Upload a video, select green or blue screen, and download the masked result
- Adjustable mask threshold slider for fine-tuning
- Modern, responsive UI
rotoscope-tool/
│
├── model-training/
│ └── model-trainer.ipynb # Jupyter notebook for model training and export
│ └── coco2017 # Coco Dataset
│ └── requirements.txt # Required Libraries
├── web-ui/
│ ├── public/
│ │ └── model.onnx # Exported ONNX model for browser inference
│ ├── src/
│ │ ├── MainPage.js # Main React component
│ │ ├── About.js # About page
│ │ └── ... # Other React components and assets
│ └── ... # React app config and build files
│
└── README.md
-
Model Training:
- Train a segmentation model to detect people in images using COCO dataset.
- Export the trained model to ONNX format for browser use.
-
Web UI:
- User uploads a video.
- Each frame is segmented in-browser using the ONNX model.
- Background is replaced with a green or blue screen.
- Video is re-encoded and available for download, all in the browser.
Note: The segmentation model was trained specifically on the "person" category from the COCO dataset. Results may vary or be less accurate for videos containing subjects other than people.
Visit the live site:
https://maskon-gs.netlify.app/
MIT License