DeepCreamPy/README.md

105 lines
4.2 KiB
Markdown
Raw Normal View History

2018-02-09 17:46:53 +00:00
# DeepMindBreak
2018-02-10 04:06:25 +00:00
*Decensoring Hentai with Deep Neural Networks*
2018-02-11 05:50:40 +00:00
This project applies an implementation of [Globally and Locally Consistent Image Completion](http://hi.cs.waseda.ac.jp/%7Eiizuka/projects/completion/data/completion_sig2017.pdf) to the problem of hentai decensorship. Using a deep fully convolutional neural network, DeepMindBreak can replace censored artwork in hentai with plausible reconstructions. The user needs to only specify the censored regions.
2018-02-10 03:36:07 +00:00
# Limitations
2018-02-11 05:50:40 +00:00
This project is LIMITED in capability. It is a proof of concept of ongoing research.
2018-02-10 03:36:07 +00:00
The decensorship works ONLY with color hentai images that have minor bar censorship of the penis or vagina.
It does NOT work with:
- Black and white images
- Scanned hentai
- Real life porn
- Mosaic censorship
- Censorship of nipples
2018-02-10 03:37:39 +00:00
- Animated gifs/videos
2018-02-10 00:48:37 +00:00
2018-02-11 05:50:40 +00:00
In particular, if a vagina or penis is completely censored out, inpainting will be ineffective.
2018-02-10 03:55:29 +00:00
2018-02-10 00:48:37 +00:00
# Dependencies
2018-02-11 05:50:40 +00:00
- Python 2
2018-02-10 00:48:37 +00:00
- TensorFlow 1.5
2018-02-10 03:16:21 +00:00
- Pillow
2018-02-10 04:01:07 +00:00
- tqdm
2018-02-11 05:50:40 +00:00
- matplotlib (only for running test.py)
2018-02-10 00:48:37 +00:00
# Model
2018-02-10 03:21:43 +00:00
The pretrained model can be downloaded from https://drive.google.com/open?id=1mWHYSj0LDSbJQQxjR4hUMykQkVve2U3Q.
2018-02-10 00:48:37 +00:00
# Usage
2018-02-10 02:03:26 +00:00
## I. Decensoring hentai
2018-02-10 01:51:41 +00:00
2018-02-10 03:16:21 +00:00
The decensorship process is fairly involved. A user interface will eventually be released to streamline the process.
2018-02-10 01:51:41 +00:00
2018-02-10 03:17:37 +00:00
Using image editing software like Photoshop or GIMP, paint the areas you want to decensor the color with RGB values of (0,255,0). For each censored region, crop 128 x 128 size images containing the censored regions from your images and save them as new ".png" images.
2018-02-10 03:16:21 +00:00
2018-02-11 05:50:40 +00:00
Move the cropped images to the "decensor_input_images" directory. Decensor the images by running
2018-02-10 03:16:21 +00:00
```
$ python decensor.py
```
2018-02-11 05:50:40 +00:00
Decensored images will be saved to the "decensor_output_images" directory. Paste the decensored images back into the original image.
2018-02-10 03:16:21 +00:00
2018-02-11 05:50:40 +00:00
## II. Train the pretrained model on custom dataset
2018-02-10 02:03:26 +00:00
2018-02-10 03:19:30 +00:00
Put the your custom dataset for training the "data/images" directory and convert images to npy format.
2018-02-10 02:03:26 +00:00
```
$ cd data
$ python to_npy.py
```
2018-02-10 03:19:30 +00:00
Train pretrained model on your custom dataset.
```
$ cd src
$ python train.py
```
2018-02-10 02:25:48 +00:00
The dataset will not be released. I do not want to risk trouble for distributing copyrighted pornographic material.
2018-02-10 02:03:26 +00:00
2018-02-10 00:48:37 +00:00
# To do
2018-02-11 05:50:40 +00:00
- Add Python 3 compatibility
2018-02-10 00:48:37 +00:00
- Add a user interface
- Incorporate GAN loss into training
2018-02-10 02:25:48 +00:00
Contributions are welcome!
2018-02-10 00:48:37 +00:00
# License
2018-02-10 04:02:04 +00:00
Model is licensed under CC BY-NC 3.0 License.
2018-02-10 01:44:21 +00:00
2018-02-10 04:02:04 +00:00
Code is licensed under MIT License and is modified from tadax's project [Globally and Locally Consistent Image Completion with TensorFlow ](https://github.com/tadax/glcic), which is an implementation of the paper [Globally and Locally Consistent Image Completion](http://hi.cs.waseda.ac.jp/%7Eiizuka/projects/completion/data/completion_sig2017.pdf).
2018-02-10 06:58:40 +00:00
2018-02-10 03:36:07 +00:00
Example image is property of [besmiled](https://www.pixiv.net/member.php?id=7902059) and allowed through Fair Use:
2018-02-10 06:58:40 +00:00
Copyright Disclaimer: Under Section 107 of the Copyright Act 1976, allowance is made for "fair use" for purposes such as criticism, comment, news reporting, teaching, scholarship and research. Fair use is a use permitted by copyright statute that might otherwise be infringing. Non-profit, educational or personal use tips the balance in favor of fair use.
---
2018-02-10 00:48:37 +00:00
2018-02-10 02:04:58 +00:00
Copyright (c) 2018 tadax, deeppomf
2018-02-10 00:48:37 +00:00
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
2018-02-10 02:04:58 +00:00
SOFTWARE.