This is an optimized fork of the original DeepMosaics project with significant performance improvements:
- 🚀 6x faster processing - Optimized GPU utilization (1h → 10 mins on AMD 7800XT)
- 🎮 AMD GPU support - DirectML integration for AMD graphics cards
- ⚡ Hardware acceleration - DirectX 11 for AMD, CUDA for NVIDIA
- 🔧 Auto-detection - Automatically detects and uses available GPU
- 🐛 Bug fixes planned - Auto dependency instllation, async I/O, batch processing
Note: The original project was revolutionary for the time - a proof of concept of sorts - and as such does not use CPU/GPU resources efficiently. This fork addresses that with substantial performance gains. Most programs also only use CUDA which locks all AMD GPU users out. Only the mosaic removal part was optimized, adding mosaics was not touched by me.
- Image & Video Processing - Remove mosaics from both static images and video files
- Multiple Network Architectures - UNet, ResNet, HD models for different use cases
- Flexible Detection - Adjustable sensitivity for mosaic detection
- Traditional Fallback - Non-AI method available for edge cases
- GUI & CLI - Choose between graphical interface or command-line operation
- Customizable Output - Control resolution, FPS, and processing parameters
| Mosaic Image | DeepCreamPy | DeepMosaicsPlus |
|---|---|---|
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
Double-click deepmosaicplusui.py or run:
python deepmosaicplusui.pypython deepmosaic.py --media_path "weenus.mkv" --model_path "clean_youknow_video.pth"- OS: Windows (DirectML requirement)
- Python: 3.6 or higher
- GPU: Any AMD or NVIDIA GPU (CPU fallback available)
- PyTorch 1.0+
- FFmpeg 3.4.6
- opencv-python
- torchvision
- AMD GPUs: torch_directml (auto-detects DirectML devices)
- NVIDIA GPUs: CUDA toolkit
- customtkinter
Download the latest pre-packaged release with models included:
📦 Download DeepMosaicsPlus.zip
Extract the zip file and you're ready to go! Skip to the Usage section.
git clone https://github.com/foooooooooooooooooooooooooootw/DeepMosaicsPlus.git
cd DeepMosaicsPluspip install torch torchvision opencv-python customtkinterFor AMD GPUs:
pip install torch-directmlFor NVIDIA GPUs: Install CUDA toolkit from NVIDIA's website
Download models and place them in ./pretrained_models/
Required files: Place mosaic_position.pth and clean_youknow_video.pth in the same directory as deepmosaic.py
python deepmosaic.py --media_path "input.mp4" --model_path "clean_youknow_video.pth"python deepmosaic.py --media_path "video.mp4" \
--start_time "00:01:30" \
--last_time "00:05:00" \
--model_path "clean_youknow_video.pth"python deepmosaic.py --media_path "image.jpg" \
--mask_threshold 30 \
--model_path "clean_youknow_video.pth"Lower threshold = more sensitive detection
| Argument | Type | Default | Description |
|---|---|---|---|
--media_path |
str |
'./imgs/ruoruo.jpg' |
Path to input image or video |
--model_path |
str |
'./clean_youknow_video.pth' |
Path to the pretrained model |
--result_dir |
str |
'./result' |
Output directory |
--gpu_id |
str |
'0' |
GPU ID (auto-detected with DirectML) |
| Argument | Type | Default | Description |
|---|---|---|---|
-ss, --start_time |
str |
'00:00:00' |
Start time (HH:MM:SS) |
-t, --last_time |
str |
'00:00:00' |
Duration (00:00:00 = entire video) |
--fps |
int |
0 |
Output FPS (0 = keep original) |
| Argument | Type | Default | Description |
|---|---|---|---|
--mask_threshold |
int |
48 |
Mosaic detection sensitivity (0-255, lower = more) |
--netG |
str |
'auto' |
Network: unet_128, unet_256, resnet_9blocks, HD, video |
--mosaic_position_model_path |
str |
'auto' |
Model for detecting mosaic positions |
--all_mosaic_area |
flag |
True |
Find all mosaic regions (not just largest) |
--no_feather |
flag |
False |
Disable edge feathering (faster, lower quality) |
| Argument | Type | Default | Description |
|---|---|---|---|
--traditional |
flag |
False |
Use non-AI traditional method |
--no_preview |
flag |
False |
Disable preview window (for servers) |
--output_size |
int |
0 |
Output resolution (0 = original) |
--temp_dir |
str |
'./tmp' |
Temporary files directory |
--debug |
flag |
False |
Enable debug mode |
For complete documentation, see [options_introduction.md]
DirectML (AMD GPUs)
- Automatically detects DirectML-capable devices
- Hardcoded to use GPU with CPU fallback
- Uses DirectX 11 for hardware video acceleration
- No need for
--gpu_idargument
CUDA (NVIDIA GPUs)
- Uses CUDA for hardware acceleration
- Specify GPU with
--gpu_id(e.g.,--gpu_id 0by default)
This fork improves on the original by:
- Better GPU utilization (original barely used GPU resources)
- Optimized FFmpeg arguments for hardware acceleration
- DirectML integration for broader GPU support
Want to train on custom datasets? Check out the training guide.
- Auto detect dependencies and install if missing
- Add batch processing for multiple files
- GPU workload saturation improvements
This project builds upon excellent work from:
- DeepMosaics - Original codebase
- pytorch-CycleGAN-and-pix2pix
- Pytorch-UNet
- pix2pixHD
- BiSeNet
- DFDNet
- GFRNet_pytorch_new
Special thanks to the original DeepMosaics project. This fork exists to optimize performance and add AMD GPU support. 🚀
Found a bug or have a feature request? Open an issue
If this project helped you, consider giving it a ⭐!







