MCPcopy Index your code
hub / github.com/HypoX64/DeepMosaics

github.com/HypoX64/DeepMosaics @v0.5.1

Chat with this repo
repository ↗ · DeepWiki ↗ · release v0.5.1 ↗ · + Follow
323 symbols 793 edges 41 files 53 documented · 16%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

DeepMosaics

English | 中文

You can use it to automatically remove the mosaics in images and videos, or add mosaics to them.

This project is based on "semantic segmentation" and "Image-to-Image Translation".

Try it at this website!

Examples

image

origin auto add mosaic auto clean mosaic
image image image
image image image
mosaic image DeepCreamPy ours
image image image
image image image
  • Style Transfer
origin to Van Gogh to winter
image image image

An interesting example:Ricardo Milos to cat

Run DeepMosaics

You can either run DeepMosaics via a pre-built binary package, or from source.

Try it on web

You can simply try to remove the mosaic on the face at this website.

Pre-built binary package

For Windows, we bulid a GUI version for easy testing.

Download this version, and a pre-trained model via [Google Drive] [百度云,提取码1x0a]

image

Attentions:

  • Requires Windows_x86_64, Windows10 is better.

  • Different pre-trained models are suitable for different effects.[Introduction to pre-trained models]

  • Run time depends on computers performance (GPU version has better performance but requires CUDA to be installed).

  • If output video cannot be played, you can try with potplayer.

  • GUI version updates slower than source.

Run From Source

Prerequisites

Dependencies

This code depends on opencv-python, torchvision available via pip install.

Clone this repo

git clone https://github.com/HypoX64/DeepMosaics.git
cd DeepMosaics

Get Pre-Trained Models

You can download pre_trained models and put them into './pretrained_models'.

[Google Drive] [百度云,提取码1x0a]

[Introduction to pre-trained models]

Simple Example

  • Add Mosaic (output media will save in './result')
python deepmosaic.py --media_path ./imgs/ruoruo.jpg --model_path ./pretrained_models/mosaic/add_face.pth --gpu_id 0
  • Clean Mosaic (output media will save in './result')
python deepmosaic.py --media_path ./result/ruoruo_add.jpg --model_path ./pretrained_models/mosaic/clean_face_HD.pth --gpu_id 0

More Parameters

If you want to test other images or videos, please refer to this file.

[options_introduction.md]

Training With Your Own Dataset

If you want to train with your own dataset, please refer to training_with_your_own_dataset.md

Acknowledgements

This code borrows heavily from [pytorch-CycleGAN-and-pix2pix] [Pytorch-UNet] [pix2pixHD] [BiSeNet] [DFDNet] [GFRNet_pytorch_new].

Core symbols most depended-on inside this repo

load
called by 10
util/dataloader.py
getparse
called by 9
cores/options.py
start
called by 8
cpp/utils/src/util.cpp
resize
called by 7
util/image_processing.py
normalize
called by 5
util/dataloader.py
video_init
called by 4
cores/init.py
_make_layer
called by 4
models/model_util.py
show_paramsnumber
called by 3
models/loadmodel.py

Shape

Function 149
Method 119
Class 54
Route 1

Languages

Python97%
C++3%

Modules by API surface

models/model_util.py43 symbols
models/pix2pixHD_model.py38 symbols
models/pix2pix_model.py35 symbols
models/BiSeNet_model.py27 symbols
models/BVDNet.py24 symbols
models/unet_model.py21 symbols
util/util.py19 symbols
util/image_processing.py17 symbols
util/data.py11 symbols
util/dataloader.py10 symbols
util/ffmpeg.py8 symbols
util/mosaic.py7 symbols

For agents

$ claude mcp add DeepMosaics \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact