{"id":13585372,"url":"https://github.com/HypoX64/DeepMosaics","last_synced_at":"2025-04-07T09:34:46.475Z","repository":{"id":37686572,"uuid":"173990533","full_name":"HypoX64/DeepMosaics","owner":"HypoX64","description":"Automatically remove the mosaics in images and videos, or add mosaics to them.","archived":false,"fork":false,"pushed_at":"2024-08-30T23:56:47.000Z","size":4135,"stargazers_count":2108,"open_issues_count":104,"forks_count":439,"subscribers_count":42,"default_branch":"master","last_synced_at":"2024-10-29T15:32:55.594Z","etag":null,"topics":["computer-vision","deep-learning","mosaic","pytorch","video-inpainting"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/HypoX64.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-03-05T17:25:47.000Z","updated_at":"2024-10-27T08:08:31.000Z","dependencies_parsed_at":"2022-07-09T03:16:19.292Z","dependency_job_id":"ff10394c-23b4-4e00-81c7-768f6afe9ab1","html_url":"https://github.com/HypoX64/DeepMosaics","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HypoX64%2FDeepMosaics","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HypoX64%2FDeepMosaics/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HypoX64%2FDeepMosaics/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HypoX64%2FDeepMosaics/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/HypoX64","download_url":"https://codeload.github.com/HypoX64/DeepMosaics/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223277828,"owners_count":17118650,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["computer-vision","deep-learning","mosaic","pytorch","video-inpainting"],"created_at":"2024-08-01T15:04:54.343Z","updated_at":"2024-11-06T03:31:01.455Z","avatar_url":"https://github.com/HypoX64.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n  \u003cimg src=\"./imgs/logo.png\" width=\"250\"\u003e\u003cbr\u003e\u003cbr\u003e\n  \u003cimg src=\"https://badgen.net/github/stars/hypox64/deepmosaics?icon=github\u0026color=4ab8a1\"\u003e\u0026emsp;\u003cimg src=\"https://badgen.net/github/forks/hypox64/deepmosaics?icon=github\u0026color=4ab8a1\"\u003e\u0026emsp;\u003ca href=\"https://github.com/HypoX64/DeepMosaics/releases\"\u003e\u003cimg src=https://img.shields.io/github/downloads/hypox64/deepmosaics/total\u003e\u003c/a\u003e\u0026emsp;\u003ca href=\"https://github.com/HypoX64/DeepMosaics/releases\"\u003e\u003cimg src=https://img.shields.io/github/v/release/hypox64/DeepMosaics\u003e\u003c/a\u003e\u0026emsp;\u003cimg src=https://img.shields.io/github/license/hypox64/deepmosaics\u003e\n\u003c/div\u003e\n\n# DeepMosaics\n\n**English | [中文](./README_CN.md)**\u003cbr\u003e\nYou can use it to automatically remove the mosaics in images and videos, or add mosaics to them.\u003cbr\u003eThis project is based on \"semantic segmentation\" and \"Image-to-Image Translation\".\u003cbr\u003eTry it at this [website](http://118.89.27.46:5000/)!\u003cbr\u003e\n\n### Examples\n\n![image](./imgs/hand.gif)\n\n|                origin                |             auto add mosaic              |             auto clean mosaic              |\n| :----------------------------------: | :--------------------------------------: | :----------------------------------------: |\n|  ![image](./imgs/example/lena.jpg)   |  ![image](./imgs/example/lena_add.jpg)   |  ![image](./imgs/example/lena_clean.jpg)   |\n| ![image](./imgs/example/youknow.png) | ![image](./imgs/example/youknow_add.png) | ![image](./imgs/example/youknow_clean.png) |\n\n- Compared with [DeepCreamPy](https://github.com/deeppomf/DeepCreamPy)\n\n|                mosaic image                |            DeepCreamPy             |                   ours                    |\n| :----------------------------------------: | :--------------------------------: | :---------------------------------------: |\n| ![image](./imgs/example/face_a_mosaic.jpg) | ![image](./imgs/example/a_dcp.png) | ![image](./imgs/example/face_a_clean.jpg) |\n| ![image](./imgs/example/face_b_mosaic.jpg) | ![image](./imgs/example/b_dcp.png) | ![image](./imgs/example/face_b_clean.jpg) |\n\n- Style Transfer\n\n|              origin              |               to Van Gogh                |                   to winter                    |\n| :------------------------------: | :--------------------------------------: | :--------------------------------------------: |\n| ![image](./imgs/example/SZU.jpg) | ![image](./imgs/example/SZU_vangogh.jpg) | ![image](./imgs/example/SZU_summer2winter.jpg) |\n\nAn interesting example:[Ricardo Milos to cat](https://www.bilibili.com/video/BV1Q7411W7n6)\n\n## Run DeepMosaics\n\nYou can either run DeepMosaics via a pre-built binary package, or from source.\u003cbr\u003e\n\n### Try it on web\n\nYou can simply try to remove the mosaic on the **face** at this [website](http://118.89.27.46:5000/).\u003cbr\u003e\n\n### Pre-built binary package\n\nFor Windows, we bulid a GUI version for easy testing.\u003cbr\u003e\nDownload this version, and a pre-trained model via [[Google Drive]](https://drive.google.com/open?id=1LTERcN33McoiztYEwBxMuRjjgxh4DEPs) [[百度云,提取码1x0a]](https://pan.baidu.com/s/10rN3U3zd5TmfGpO_PEShqQ) \u003cbr\u003e\n\n- [[Help document]](./docs/exe_help.md)\u003cbr\u003e\n- Video tutorial =\u003e [[youtube]](https://www.youtube.com/watch?v=1kEmYawJ_vk) [[bilibili]](https://www.bilibili.com/video/BV1QK4y1a7Av)\n\n![image](./imgs/GUI.png)\u003cbr\u003e\nAttentions:\u003cbr\u003e\n\n- Requires Windows_x86_64, Windows10 is better.\u003cbr\u003e\n- Different pre-trained models are suitable for different effects.[[Introduction to pre-trained models]](./docs/pre-trained_models_introduction.md)\u003cbr\u003e\n- Run time depends on computers performance (GPU version has better performance but requires CUDA to be installed).\u003cbr\u003e\n- If output video cannot be played, you can try with [potplayer](https://daumpotplayer.com/download/).\u003cbr\u003e\n- GUI version updates slower than source.\u003cbr\u003e\n\n### Run From Source\n\n#### Prerequisites\n\n- Linux, Mac OS, Windows\n- Python 3.6+\n- [ffmpeg 3.4.6](http://ffmpeg.org/)\n- [Pytorch 1.0+](https://pytorch.org/)\n- CPU or NVIDIA GPU + CUDA CuDNN\u003cbr\u003e\n\n#### Dependencies\n\nThis code depends on opencv-python, torchvision available via pip install.\n\n#### Clone this repo\n\n```bash\ngit clone https://github.com/HypoX64/DeepMosaics.git\ncd DeepMosaics\n```\n\n#### Get Pre-Trained Models\n\nYou can download pre_trained models and put them into './pretrained_models'.\u003cbr\u003e\n[[Google Drive]](https://drive.google.com/open?id=1LTERcN33McoiztYEwBxMuRjjgxh4DEPs) [[百度云,提取码1x0a]](https://pan.baidu.com/s/10rN3U3zd5TmfGpO_PEShqQ)\u003cbr\u003e\n[[Introduction to pre-trained models]](./docs/pre-trained_models_introduction.md)\u003cbr\u003e\n\nIn order to add/remove mosaic, there must be a model file `mosaic_position.pth` at `./pretrained_models/mosaic/mosaic_position.pth`\n\n#### Install dependencies\n\n(Optional) Create a virtual environment\n\n```bash\nvirtualenv mosaic\nsource mosaic/bin/activate\n```\n\nThen install the dependencies\n\n```bash\npip install -r requirements.txt\n```\n\nIf you can not build `scikit-image`, running `export CFLAGS='-Wno-implicit-function-declaration` then try to rebuild.\n\n#### Simple Example\n\n- Add Mosaic (output media will be saved in './result')\u003cbr\u003e\n\n```bash\npython deepmosaic.py --media_path ./imgs/ruoruo.jpg --model_path ./pretrained_models/mosaic/add_face.pth --gpu_id 0\n```\n\n- Clean Mosaic (output media will save in './result')\u003cbr\u003e\n\n```bash\npython deepmosaic.py --media_path ./result/ruoruo_add.jpg --model_path ./pretrained_models/mosaic/clean_face_HD.pth --gpu_id 0\n```\n\nIf you see the error `Please check mosaic_position_model_path!`, check if there is a model file named `mosaic_position.pth` at `./pretrained_models/mosaic/mosaic_position.pth`\n\n#### More Parameters\n\nIf you want to test other images or videos, please refer to this file.\u003cbr\u003e\n[[options_introduction.md]](./docs/options_introduction.md) \u003cbr\u003e\n\n## Training With Your Own Dataset\n\nIf you want to train with your own dataset, please refer to [training_with_your_own_dataset.md](./docs/training_with_your_own_dataset.md)\n\n## Acknowledgements\n\nThis code borrows heavily from [[pytorch-CycleGAN-and-pix2pix]](https://github.com/junyanz/pytorch-CycleGAN-and-pix2pix) [[Pytorch-UNet]](https://github.com/milesial/Pytorch-UNet) [[pix2pixHD]](https://github.com/NVIDIA/pix2pixHD) [[BiSeNet]](https://github.com/ooooverflow/BiSeNet) [[DFDNet]](https://github.com/csxmli2016/DFDNet) [[GFRNet_pytorch_new]](https://github.com/sonack/GFRNet_pytorch_new).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FHypoX64%2FDeepMosaics","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FHypoX64%2FDeepMosaics","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FHypoX64%2FDeepMosaics/lists"}