General Introduction
DeepMosaics is an open source project based on semantic segmentation and image-to-image conversion techniques designed to automatically remove mosaics from, or add mosaic effects to, images and videos. The project leverages the power of deep learning to provide users with an efficient way to work with mosaic images, whether decoded or encoded.DeepMosaics supports Windows, Linux and Mac OS systems, and is especially suited to run on NVIDIA GPUs with CUDA environments installed to take full advantage of GPU acceleration.
As the project is older, installing according to the default process may cause anomalies due to the version of the dependent environment, please install the latest one-click deployment package provided.
Function List
- Automatically remove mosaics from pictures and videos
- Automatically add mosaic effects
- Support for multiple operating systems (Windows, Linux, Mac OS)
- Efficient processing using deep learning techniques
- Provide pre-trained models to improve processing
- Support for training models with customized data
Using Help
Installation steps
- Cloning Project:
git clone https://github.com/HypoX64/DeepMosaics.git cd DeepMosaics
- Create and activate a virtual environment (optional):
virtualenv mosaic source mosaic/bin/activate
- Install the dependencies:
pip install -r requirements.txt
Dependent version is old, please edit to remove the version number and install.
Adding a Mosaic
Use the following command to add a mosaic to an image:
python deepmosaic.py --media_path . /path/to/your/image.jpg ---model_path . /pretrained_models/mosaic/add_face.pth --gpu_id 0
mosaic removal
Use the following command to remove the mosaic from the picture:
python deepmosaic.py --media_path . /result/path/to/your/image_with_mosaic.jpg ---model_path . /pretrained_models/mosaic/clean_face_HD.pth --gpu_id 0
caveat
- Ensure that the pre-trained model is downloaded and placed under the correct path.
- Runtime depends on computer performance, and it is recommended to run on a GPU for faster processing.
- For video files, it is recommended to use potplayer to play the output.
Use cases and best practices
DeepMosaics is used in a wide range of applications such as privacy protection, art creation and video editing. For example, by removing mosaics from portraits, performing facial recognition verification during identity authentication (for legal purposes only), or the reverse, adding blurring to sensitive information for privacy security. Artists can use this tool to migrate the style of famous paintings to mosaic-containing images to create unique visual artworks, such as turning a photo of a human face into a Van Gogh style.
New version of the client one-click installation package
Older version: