diff --git a/README.md b/README.md index 50460c1ec71afaf3234de8f0b5b9c21b9725e958..67f6c07ea564c25ba9b85f085d980ddf7b8d94ae 100755 --- a/README.md +++ b/README.md @@ -1,12 +1,11 @@ -![image](https://github.com/HypoX64/DeepMosaics/blob/master/imgs/hand.gif) -# DeepMosaics +![image](./imgs/hand.gif) +# DeepMosaics You can use it to automatically remove the mosaics in images and videos, or add mosaics to them.
-This porject based on ‘semantic segmentation’ and ‘Image-to-Image Translation’. -
+This porject based on ‘semantic segmentation’ and ‘Image-to-Image Translation’.
+* [中文版](./README_CN.md)
## Notice -The code do not include the part of training, I will finish it in my free time. -
+The code do not include the part of training, I will finish it in my free time.
## Run DeepMosaics You can either run DeepMosaics via pre-built binary package or from source.
@@ -15,10 +14,11 @@ You can either run DeepMosaics via pre-built binary package or from source.
For windows, we bulid a GUI version for easy test.
Download this version via [[Google Drive]](https://drive.google.com/open?id=1LTERcN33McoiztYEwBxMuRjjgxh4DEPs) [[百度云,提取码1x0a]](https://pan.baidu.com/s/10rN3U3zd5TmfGpO_PEShqQ)
-![image](https://github.com/HypoX64/DeepMosaics/blob/master/imgs/GUI.png)
+![image](./imgs/GUI.png)
Attentions:
- Require Windows_x86_64, Windows10 is better.
+- Different pre-trained models are suitable for different effects.
- Run time depends on computer performance.
- If output video cannot be played, you can try with [potplayer](https://daumpotplayer.com/download/). @@ -55,4 +55,4 @@ If you want to test other image or video, please refer to this file.
## Acknowledgments -This code borrows heavily from [[pytorch-CycleGAN-and-pix2pix]](https://github.com/junyanz/pytorch-CycleGAN-and-pix2pix) [[Pytorch-UNet]](https://github.com/milesial/Pytorch-UNet). +This 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). diff --git a/README_CN.md b/README_CN.md new file mode 100644 index 0000000000000000000000000000000000000000..dcd953702d1285aea7b1391ff6935c5ca321c420 --- /dev/null +++ b/README_CN.md @@ -0,0 +1,56 @@ +![image](./imgs/hand.gif) +# DeepMosaics +这是一个通过深度学习自动的为图片/视频添加马赛克,或消除马赛克的项目.
它基于“语义分割”以及“图像翻译”.
+ +## 一些说明 +代码暂不包含训练部分,训练方法我将在空闲时间给出.
+现在,代码已经支持基于[pix2pixHD](https://github.com/NVIDIA/pix2pixHD)训练出的模型,但网络仍在训练中,这将使得输出结果看起来更加清晰,"真实".
+ +## 如何运行 +可以通过我们预编译好的二进制包或源代码运行.
+ +### 预编译的程序包 +对于Windows用户,我们提供了包含GUI界面的免安装软件包.
+可以通过下面两种方式进行下载: [[Google Drive]](https://drive.google.com/open?id=1LTERcN33McoiztYEwBxMuRjjgxh4DEPs) [[百度云,提取码1x0a]](https://pan.baidu.com/s/10rN3U3zd5TmfGpO_PEShqQ)
+ +![image](./imgs/GUI.png)
+ +注意事项:
+- 程序的运行要求在64位Windows操作系统,我仅在Windows10下运行过,其他版本暂未经过测试
+- 请根据需求选择合适的预训练模型进行测试
+- 运行时间取决于电脑性能,对于视频文件,我们建议可以先使用截图进行测试.
+- 如果输出的视频无法播放,这边建议您可以尝试[potplayer](https://daumpotplayer.com/download/). + +### 通过源代码运行 +#### 前提要求 +- Linux, Mac OS, Windows +- Python 3.6+ +- [ffmpeg 3.4](http://ffmpeg.org/) +- [Pytorch 1.0+](https://pytorch.org/) [(Old version codes)](https://github.com/HypoX64/DeepMosaics/tree/Pytorch0.4) +- CPU or NVIDIA GPU + CUDA CuDNN
+#### Python依赖项 +代码依赖于opencv-python以及 torchvision,可有通过pip install 进行安装. +#### 克隆源代码: +```bash +git clone https://github.com/HypoX64/DeepMosaics +cd DeepMosaics +``` +#### 下载测试视频以及预训练模型 +可以通过以下两种方法下载测试视频以及预训练模型,并将他们置于项目文件夹中.
+[[Google Drive]](https://drive.google.com/open?id=10nARsiZoZGcaKw40nQu9fJuRp1oeabPs) [[百度云,提取码7thu]](https://pan.baidu.com/s/1IG4bdIiIC9PH9-oEyae5Sg) + +#### 简单的例子 +* 为视频添加马赛克,例子中认为手是需要打码的区域 ,可以通过切换预训练模型切换自动打码区域(输出结果将储存到 './result') +```bash +python3 deepmosaic.py +``` +* 将视频中的马赛克移除,对于不同的打码物体需要使用对应的预训练模型进行马赛克消除(输出结果将储存到 './result') +```bash +python3 deepmosaic.py --mode clean --model_path ./pretrained_models/clean_hands_unet_128.pth --media_path ./result/hands_test_AddMosaic.mp4 +``` +#### 更多的参数 +如果想要测试其他的图片或视频,请参照以下文件输入参数. +[[options.py]](https://github.com/HypoX64/DeepMosaics/blob/master/options.py)
+ +## 鸣谢 +代码大量的参考了以下项目:[[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).. diff --git a/imgs/icon.jpg b/imgs/icon.jpg new file mode 100644 index 0000000000000000000000000000000000000000..672f6ed3b95d94f47de1e59ad73939879497ca47 Binary files /dev/null and b/imgs/icon.jpg differ