Giter Site home page Giter Site logo

hent-ai's Introduction

Detecting censors with deep learning and computer vision

Illustrated adult content created in Japan is required to be censored by law. Two common types of censoring involves censor bars and mosaic blurs. For us degenerates living outside of Japan, this means we are also subject to the bars and mosaics. There is a solution, DeepCreamPy by deeppomf that can draw over the censors, given that you tell it where the censors are. That is a long and painstaking process, so I hope to automate that process with this project. This project will utilize deep learning and image segmentation, techniques typically used in autonomous vehicles and computer vision tasks. New for 1.6.3, we added ESRGAN as an alternative to DeepCreamPy, which will also decensor a mosaic image/video after the detection.

This is built atop Matterport's Mask R-CNN, and video decensoring uses ESRGAN.

Here is a NSFW Video that shows better what this project does, on old model 161.

Twitter (NSFW). Twitter Follow

Like what you see? Help fund this project: paypal

You can join development and news discussion on the Discord channel: https://discord.gg/j4dPZ7W

Example of bar detection on model 226: Detection Sample

Examples of mosaic detection on model 236: Detection Sample2

For both of those examples, the newest model 161 provides far more accurate masks and detection.

Getting Started

You will need all the same requirements as matterport's Mask RCNN implementation, nothing more. Note that I am using tensorflow 1.8.0, tensorflow-gpu 1.9.0, torch 0.4.1, and keras 2.2.0. I have not fully tested the stability of newer combinations. I use Anaconda3 for my command line.

Only windows is supported for the executable. You can pull this code for linux.

The code

  • main.py Contains GUI and all I/O handling and file parsing, along with basic error detection. Instantiates detector class.

  • detector.py Contains my detector class, which is responsible for neural network bringup, starting inference detection, and creating overlay from mask for DCP. No longer needs hentai.py, and can run detections on its own. Also handles ESRGAN functionality.

  • hentai.py Interfaces between my detector and the model. Based off of the Balloon.py of the Mask RCNN implementation. Only needed for training.

  • inspect_h_model.ipynb This notebook is identical to the balloon notebook. I modified it to work with this project instead, and it is best used to inspect a model. For detailed logging, use Tensorboard (which should be installed if you have tensorflow)

  • inspect_h_data.ipynb Same thing as above, except this notebook is used to validate the dataset. Also has cool information showing some of the quirks and features of MaskRcnn

  • test_combined_generator.py Script that automates bar censoring and annotation, more explained below. This is meant to be placed in a separate folder, and expects uncensored images in a folder called "decensored_input" and outputs the barred image into "decensored_input_original", and populates a csv with the annotations. You do not need to use this script, unless you want to help in expanding the dataset. In which case, join the discord and contact me.

  • hent_AI_COLAB_1.ipynb Google Colab notebook with instructions for ESRGAN video decensoring. This will use Google's GPUs on the cloud for free, and should be faster than most, if not all consumer GPUs. But, sessions will get deleted after 30 minutes of idle or 12 hours. I reccommend this option for any sort of video decensoring, it is visually good enough and really fast.

  • green_mask_project_mosaic_resolution.py Script from GMP that estimates a mosaic's granularity (size of the mosaic boxes) for use in ESRGAN decensoring.

  • hconfig.ini Configuration file that holds directory information.

The Dataset

The dataset has a mix of some hand-done annotations, and mostly hand-done annotated images using our test_combined_generator. This script takes uncensored images as input, and can create a clone of the image with a mosaic and random bar censors, using NudeNet. This dataset is not provided here. You can contact me on Discord if you are interested.

Dataset annotations have were made with the polygon shape. Bar and Mosaic region attributes are formated as:

"region_attributes":{"censor":"bar"}} OR "region_attributes":{"censor":"mosaic"}}

Here is a (NSFW) sample of my dataset annotations, along with the vgg editor.

The Model

You will want the latest model for better accuracy.

Simply delete your current weights.h5 file, and replace with the new one. Please keep the model named as weights.h5

ESRGAN (on the code only) is using Twittman's fatal pixels model for 4x superscaling. It is not on this repo as it is protected by MPL-2.0. Download the model 340000 here from his repo. Place this model in the main directory.

Requirements

You will need to download and install DeepCreamPy, which is linked in the intro.

The executable will need ffmpeg if you want sound to carry over on videos. Place ffmpeg.exe in the main directory, or somewhere defined in your PATH or in an environment variable. For linux, clone the repo and follow the provided instructions for getting its requirements. To get ffmpeg on linux or colab, use:

!sudo add-apt-repository ppa:jon-severinsson/ffmpeg
!sudo apt-get update
!sudo apt-get install ffmpeg

(Source code on Windows) I would reccomend running these on a virtual environment, with Anaconda3. Python 3.5.2, TensorFlow 1.8, Keras 2.2, tensorflow-gpu 1.9.0, torch 0.4.1 and other common packages listed in requirements.txt.

  • For now, DCP is required until I can create my own alternative. This project expects to use the DCP directory. You can install the executable or the source code, either should work.

  • DCP is ONLY compatible with .png images, and not jpg. Either you use png only or try the provided jpg converter (Force jpg button). You can use online tools like jpg2png. Again, this should be done before anything else.

  • DCP is NOT compatible with screentones, or that dotted effect that is characteristic of printed works (see below). Simply refer to my other project, Screentone Remover, which will batch remove screentones using Digital Signal Processing techniques. This is the only way for printed non-colored images to be decensored.

Here is an example of a screentoned image, and what it looks like when removed by my Screentone Remover app: Screentone removal example

  • For full video decensoring via ESRGAN, you will need to download Twittman's model here and place it inside the ColabESRGAN/models folder.

  • Nvidia GPU owners should install CUDA 9.0, and cuDNN 7.6.4. Note that there are issues with RTX cards and ESRGAN, so if you want to use that I again reccomend the colab notebook instead.

Important Notes (READ BEFORE USING)

  • I highly reccommend running hent-AI on batches, for example one doujin or a few doujins at once. The slowest part of hent-AI is the initialization, so the first inference takes time but the rest will be quicker.

  • The current model is not perfect. Yet. Expect some trouble with white censor bars, small censor bars, partially-transparent censor bars, and censor bars that are fused together as one large censor. Any absurd amount of censoring may cause issues for hent-AI.

  • This model is not trained in recognizing full censorship, where genetalia is not drawn at all. Non-standard censoring is also not supported.

  • The model supports mosaics and bars, but it really struggles when both are used on the same spot. Also, DCP can only generate for bars or mosaics, so you will need to keep mosaic censoring works separate from bar censored works. If you must decensor images with both, I suggest decensoring the bars on one run, then the mosaics on a seconds run.

  • CUDA compatible Nvidia GPUs are reccommended for large amounts of images, or videos. If you don't have one, refer to the colab notebook.

  • The Video Maker button creates a video from the output of DCP in decensored_output. Run this after DCP completes. Note you still need to select the directories for the source video, and the DCP install directory.

  • Do not put entire clips through the video detection, it is a very slow task. If you can, edit in only the short clips with visible mosaics, get the decensored output, then edit them in the rest of the video.

  • The compiled exe release does not support ESRGAN. If you want to use this, refer to the colab notebook.

Versions and Downloads

  • v1.0.0: Initial release for 2020 HackIllinois Demo

  • v1.1.0: Cleaned code, removed unneeded library imports, added install instructions and tutorial. Added error detection.

  • v1.2.0: Executable release based off of the detect-only branch. Training and redundant libraries have been removed or relocated. Bug where entire image returns green fixed. Lowered detection threshold.

  • v1.3.0: (exe not released yet) Removed non-unicode error. Added loading screen popup. Lowered detection threshold. Minor UI changes.

  • v1.4.0: Fixed video detector incorrectly naming files. Added loading popup. UI tweaks. Lowered detection threshold.

  • v1.5.0: Fixed greyscale shape error. Fixed bug where video was copied to DCP folder. Added support for jpg, as an option for jpg to png conversion. Added better exception catching. Updated weights to model 236.

  • v1.5.2: Upgraded tensorflow to 1.8 in preparation for future video detection features. Image errors no longer stop program and get skipped. Terminal printing is more informative. UI Tweaks.

  • 1.6.3: Added ESRGAN for video decensoring, DCP not required for this. Further support for non-unicode filenames.

  • 1.6.5: Added adaptive mosaic granularity checking via GMP by rekaXua. Added colab file for free cloud-based ESRGAN video decensoring.

  • 1.6.7: Changed ESRGAN processs to run in 2 phases: ESRGAN resize, then mask detection. Slower but more memory forgiving. Added mask blurring for less seams on ESRGAN. For non-ESRGAN, added custom dilation to expand masks. Removed option for jpg, it will be used automatically. Improved file cleaning.

  • 1.6.8: Videos will now take audio from the source video, using ffmpeg. Variable video bitrate is not yet available, so filesizes may not match the source. ESRGAN will now save videos to the same directory as the source video, mostly to help with the Colab.

  • 1.6.9: Minor UI tweaks. There is now a hconfig.ini that will save your previous used directories and settings on startup. During detection process for images and video, total image/frame count will be displayed.

  • 1.6.9b: Hotfix for ESRGAN and ESRGAN video. Fixed bug with the .ini. Note: .exe is unaffected, so no need for another version.

  • 1.6.9c: Hotfix for image and mosaic decensoring for colab. Note: .exe is unaffected, so no need for another version.

Installation directions

For detailed instructions, follow Install_and_Tutorial.txt

Executable:

  • Install from the links above

  • Extract to some folder

  • Follow Install_and _tutorial for more

Code:

  • After cloning this repo, first install the requirements:
pip install -r requirements.txt
  • Next, compile maskrcnn:
python setup.py install
  • To run hentAI, run
python main.py

In the main directory. Follow the UI instructions from there.

  • Not needed, but to train, run
python samples\hentai\hentai.py train --dataset=dataset_img/ --weights=path/to/weights

Alternatively, you can resume training using --weights=last

Contributing

Contributions and improvements to this repo are welcome, so I would encourage joining the Discord.

Acknowledgements

Inspiration from DeepCreamPy

Mask Rcnn implementation from Matterport

Obtained weights from mattya's chainer-DCGAN

ESRGAN implementation from this paper, using their old architecture provided by styler00dollar

Using Twittman's trained model fatal pixels.

Dataset annotated with VGG annotator

Sample asset images from artist @ao_beni, 落書き色々まとめ, and @paxiti respectively. Screentone girl is from artist soranosuzume.

Current asset images from うぱ西まり子 and bibimbub on Pixiv.

hent-ai's People

Contributors

bill2239 avatar borda avatar cclauss avatar concerttttt avatar coreyhu avatar cpruce avatar jmtatsch avatar jningwei avatar keineahnung2345 avatar llltttppp avatar marluca avatar maxfrei750 avatar moorage avatar mowoe avatar natethegreate avatar np-csu avatar philferriere avatar ps48 avatar rekaxua avatar robaleman avatar rymalia avatar skt7 avatar stevenhickson avatar veemon avatar viredery avatar waleedka avatar xelmirage avatar yanfengliu avatar yqnlp avatar ziyigogogo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

hent-ai's Issues

how do I use this

in the instructions for this it said to unzip the file which I did and then open main.exe and there is no main.exe the only file that says main is main.py which I can't even open

CUDA driver version is insufficient for CUDA runtime version at...

Hello,

I have tried several ways to run the program, but can't find a way to run on a video properly.

Using the .exe, it doesn't detect my 1070, despite CUDA 9.0 and cuDNN 7.6.4 properly installed.
Using the colab, I always get a Tesla P4, and it doesn't work in the end, printing memory errors.

So I tried using the code directly. It detects my GPU but fails later. Here are the logs:
https://pastebin.com/bFxXUDRq

I installed cuDNN v7.6.4 (September 27, 2019) and CUDA 9.0 so I don't understand how this happens. I'm not really experienced with CUDA and can't seem to find a solution online elsewhere so I'm trying here.

Thanks in advance.

CUDNN_STATUS_INTERNAL_ERROR on 2nd Phase of Video Processing

Using the proper GPU (as recommended) on google colab, I get the following error every time:

Video read complete. Starting video phase 2: detection + splice
frame:  0 / 7032.0
2020-09-04 20:33:18.236907: E tensorflow/stream_executor/cuda/cuda_dnn.cc:332] could not create cudnn handle: CUDNN_STATUS_INTERNAL_ERROR

I looked into the error on StackOverflow but everyone says there might be a mismatch between CuDNN and Cuda versions. I tried upgrading the cuda-repo-ubuntu1604-9-0-local_9.0.176-1_amd64-deb to its 10.1 equivalent but hent-ai is hooked on the 9.0 version due to its references it appears.

Is there a better fix for CUDNN_STATUS_INTERNAL_ERROR?

(ESRGAN) Cannot initialize CUDA without ATen_cuda library.

mosaic (DCP) work fine with cuda GPU, but trying to use mosaic (ESRGAN) gives this -

Starting ESRGAN detection and decensor Exception in Tkinter callback Traceback (most recent call last): File "C:\Users\Clanf\AppData\Local\Programs\Python\Python36\lib\tkinter\__i nit__.py", line 1705, in __call__ return self.func(*args) File "main.py", line 311, in <lambda> go_button = Button(mos_win, text="Go!", command = lambda: hentAI_TGAN(in_pat h=o_entry.get(), is_video=False)) File "main.py", line 184, in hentAI_TGAN detect_instance.run_ESRGAN(in_path = in_path, is_video = is_video, force_jpg = force_jpg) File "D:\hent-AI\detector.py", line 377, in run_ESRGAN self.esrgan_instance = ColabESRGAN.test.esrgan(model_path=self.esr_model_pat h, hw=self.hardware) File "D:\hent-AI\ColabESRGAN\test.py", line 24, in __init__ self.model = self.model.to(self.device) File "C:\Users\Clanf\AppData\Local\Programs\Python\Python36\lib\site-packag es\torch\nn\modules\module.py", line 379, in to return self._apply(convert) File "C:\Users\Clanf\AppData\Local\Programs\Python\Python36\lib\site-packag es\torch\nn\modules\module.py", line 185, in _apply module._apply(fn) File "C:\Users\Clanf\AppData\Local\Programs\Python\Python36\lib\site-packag es\torch\nn\modules\module.py", line 185, in _apply module._apply(fn) File "C:\Users\Clanf\AppData\Local\Programs\Python\Python36\lib\site-packag es\torch\nn\modules\module.py", line 191, in _apply param.data = fn(param.data) File "C:\Users\Clanf\AppData\Local\Programs\Python\Python36\lib\site-packag es\torch\nn\modules\module.py", line 377, in convert return t.to(device, dtype if t.is_floating_point() else None, non_blocking) RuntimeError: Cannot initialize CUDA without ATen_cuda library. PyTorch splits i ts backend into two shared libraries: a CPU library and a CUDA library; this err or has occurred because you are trying to use some CUDA functionality, but the C UDA library has not been loaded by the dynamic linker for some reason. The CUDA library MUST be loaded, EVEN IF you don't directly use any symbols from the CUD A library! One common culprit is a lack of -Wl,--no-as-needed in your link argum ents; many dynamic linkers will delete dynamic library dependencies if you don't depend on any of their symbols. You can check if this has occurred by using ld d on your binary to see if there is a dependency on *_cuda.so library.

how to select GPU

I have two CUDA compatible GPUs. How to choose the one I need to work with a neural network (so that the second one is not loaded)

Error: could not create cudnn handle: CUDNN_STATUS_INTERNAL_ERROR in colab file

Basically I am already at the part of this
line

# Make sure videos are in the videos folder inside hent-AI
!python samples/hentai/hentai.py inference --weights=weights.h5 --sources=/content/drive/My\ Drive/hent-AI/videos/ --dtype=esrgan

but when I run it I am getting a TF error, my video is only 7 seconds long

/usr/local/lib/python3.5/site-packages/tensorflow/python/framework/dtypes.py:523: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
  _np_qint8 = np.dtype([("qint8", np.int8, 1)])
/usr/local/lib/python3.5/site-packages/tensorflow/python/framework/dtypes.py:524: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
  _np_quint8 = np.dtype([("quint8", np.uint8, 1)])
/usr/local/lib/python3.5/site-packages/tensorflow/python/framework/dtypes.py:525: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
  _np_qint16 = np.dtype([("qint16", np.int16, 1)])
/usr/local/lib/python3.5/site-packages/tensorflow/python/framework/dtypes.py:526: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
  _np_quint16 = np.dtype([("quint16", np.uint16, 1)])
/usr/local/lib/python3.5/site-packages/tensorflow/python/framework/dtypes.py:527: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
  _np_qint32 = np.dtype([("qint32", np.int32, 1)])
/usr/local/lib/python3.5/site-packages/tensorflow/python/framework/dtypes.py:532: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
  np_resource = np.dtype([("resource", np.ubyte, 1)])
Using TensorFlow backend.
Weights:  weights.h5
Dataset:  None
Logs:  /logs
Starting inference
2020-04-26 18:52:04.701074: I tensorflow/core/platform/cpu_feature_guard.cc:141] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 AVX512F FMA
2020-04-26 18:52:04.858325: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:897] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero
2020-04-26 18:52:04.858892: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1392] Found device 0 with properties: 
name: Tesla T4 major: 7 minor: 5 memoryClockRate(GHz): 1.59
pciBusID: 0000:00:04.0
totalMemory: 14.73GiB freeMemory: 14.62GiB
2020-04-26 18:52:04.858943: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1471] Adding visible gpu devices: 0
2020-04-26 18:52:05.266501: I tensorflow/core/common_runtime/gpu/gpu_device.cc:952] Device interconnect StreamExecutor with strength 1 edge matrix:
2020-04-26 18:52:05.266561: I tensorflow/core/common_runtime/gpu/gpu_device.cc:958]      0 
2020-04-26 18:52:05.266574: I tensorflow/core/common_runtime/gpu/gpu_device.cc:971] 0:   N 
2020-04-26 18:52:05.266685: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1084] Created TensorFlow device (/device:GPU:0 with 14147 MB memory) -> physical GPU (device: 0, name: Tesla T4, pci bus id: 0000:00:04.0, compute capability: 7.5)
CUDA-compatible GPU located!
Model warmup complete
2020-04-26 18:52:10.653999: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1471] Adding visible gpu devices: 0
2020-04-26 18:52:10.654084: I tensorflow/core/common_runtime/gpu/gpu_device.cc:952] Device interconnect StreamExecutor with strength 1 edge matrix:
2020-04-26 18:52:10.654101: I tensorflow/core/common_runtime/gpu/gpu_device.cc:958]      0 
2020-04-26 18:52:10.654120: I tensorflow/core/common_runtime/gpu/gpu_device.cc:971] 0:   N 
2020-04-26 18:52:10.654225: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1084] Created TensorFlow device (/job:localhost/replica:0/task:0/device:GPU:0 with 14147 MB memory) -> physical GPU (device: 0, name: Tesla T4, pci bus id: 0000:00:04.0, compute capability: 7.5)
Loading weights...  Weights loaded
Detected fps: 23.976023976023978
Video read complete, starting video detection. NOTE: frame 0 may take up to 1 minute
frame:  0
2020-04-26 18:52:16.429973: E tensorflow/stream_executor/cuda/cuda_dnn.cc:332] could not create cudnn handle: CUDNN_STATUS_INTERNAL_ERROR

error on error

How the fuck install this all? I'll blow my ass right now...

Cannot decensor large video files

While testing the decensoring of a large video file (906MB, length: 22:16), I have run into an issue where the program stops
working while throwing an error that is has reached a memory limit of about 450MB. Previous testing with a much lighter file (7.25MB, length: 0:27) reveals that the program does indeed work as intended (provided you use a workaround for issue #11).

This is far below what my machine should be capable of handling, I would at least have expected it to do a few gigabytes, given that I have 32GB of RAM and 11GB of VRAM.

PC specs:

  • CPU: Intel i7-9700k
  • GPU: Nvidia GeForce RTX 2080 Ti
  • RAM: Corsair Vengeance LPX 32GB (2 x 16GB) DDR4 3000MHz

CPU-Z full PC specs:
specs.txt

Here's the relevant commandline output:

2020-06-29 14:05:00.125065: I tensorflow/core/common_runtime/bfc_allocator.cc:816] Sum Total of in-use chunks: 437.27MiB
2020-06-29 14:05:00.127624: I tensorflow/core/common_runtime/bfc_allocator.cc:818] total_region_allocated_bytes_: 458508544 memory_limit_: 458508696 available bytes: 152 curr_region_allocation_bytes_: 917017600
2020-06-29 14:05:00.131488: I tensorflow/core/common_runtime/bfc_allocator.cc:824] Stats:
Limit:                   458508696
InUse:                   458508544
MaxInUse:                458508544
NumAllocs:                     908
MaxAllocSize:             51380224

2020-06-29 14:05:00.135537: W tensorflow/core/common_runtime/bfc_allocator.cc:319] ****************************************************************************************************
2020-06-29 14:05:00.138928: W tensorflow/core/framework/op_kernel.cc:1479] OP_REQUIRES failed at constant_op.cc:77 : Resource exhausted: OOM when allocating tensor of shape [] and type float
2020-06-29 14:05:00.141894: E tensorflow/core/common_runtime/executor.cc:641] Executor failed to create kernel. Resource exhausted: OOM when allocating tensor of shape [] and type float
         [[{{node roi_align_mask_1/truediv/x}}]]

Full output:
output.txt

dcp_dir is not defined (ESRGAN)

Hi, when running the code on a CUDA compatible GPU and choosing the ESRGAN option (both mosaic and video), I get this error:

File "main.py", line 313, in <lambda>
    go_button = Button(mos_win, text="Go!", command = lambda: hentAI_TGAN(in_path=o_entry.get(), is_video=False))
File "main.py", line 174, in hentAI_TGAN
    hconfig['USER']['dcpdir'] = dcp_dir
NameError: name 'dcp_dir' is not defined

It seems that the code is still trying to locate the DCP folder in ESRGAN mode, and crashes since you don't get a prompt to put the path to it..

Deprecation of Python 3.5

Setting up the conda env with python 3.5 comes with pip 10.0.1. Trying to install from requirements-gpu.txt errors out with this version, but after updating pip to 20.3.1 the requirements install worked perfectly. It would be worth checking out if using a more recent version of python will work in-place of python 3.5 since it will not work with pip 21.0 once that releases.

(hentai) [alexander@BrickArch hent-AI]$ pip install --upgrade pip
Collecting pip
  Downloading https://files.pythonhosted.org/packages/ab/11/2dc62c5263d9eb322f2f028f7b56cd9d096bb8988fcf82d65fa2e4057afe/pip-20.3.1-py2.py3-none-any.whl (1.5MB)
    100% |████████████████████████████████| 1.5MB 12.0MB/s 
Installing collected packages: pip
  Found existing installation: pip 10.0.1
    Uninstalling pip-10.0.1:
      Successfully uninstalled pip-10.0.1
Successfully installed pip-20.3.1
(hentai) [alexander@BrickArch hent-AI]$ pip install -r requirements-gpu.txt 
DEPRECATION: Python 3.5 reached the end of its life on September 13th, 2020. Please upgrade your Python as Python 3.5 is no longer maintained. pip 21.0 will drop support for Python 3.5 in January 2021. pip 21.0 will remove support for this functionality.   

ImportError: libcublas.so.9.0: cannot open shared object file: No such file or directory

Hello! I realy proud that our cyber-samuraies fighting with censore! I wish you success!
But i have problem:

  1. System: Parrot OS
  2. I installed setup.py successfully
  3. I launched main.py
    ERROR

┌─[root@parrot]─[/home/user/Desktop/hent-AI]
└──╼ #python main.py
Traceback (most recent call last):
File "main.py", line 14, in
from detector import Detector
File "/home/user/Desktop/hent-AI/detector.py", line 23, in
from mrcnn import model as modellib, utils
File "/home/user/Desktop/hent-AI/mrcnn/model.py", line 19, in
import tensorflow as tf
File "/usr/local/lib/python2.7/dist-packages/tensorflow/init.py", line 22, in
from tensorflow.python import pywrap_tensorflow # pylint: disable=unused-import
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/init.py", line 49, in
from tensorflow.python import pywrap_tensorflow
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/pywrap_tensorflow.py", line 74, in
raise ImportError(msg)
ImportError: Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/pywrap_tensorflow.py", line 58, in
from tensorflow.python.pywrap_tensorflow_internal import *
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/pywrap_tensorflow_internal.py", line 28, in
_pywrap_tensorflow_internal = swig_import_helper()
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/pywrap_tensorflow_internal.py", line 24, in swig_import_helper
_mod = imp.load_module('_pywrap_tensorflow_internal', fp, pathname, description)
ImportError: libcublas.so.9.0: cannot open shared object file: No such file or directory

Failed to load the native TensorFlow runtime.

See https://www.tensorflow.org/install/install_sources#common_installation_problems

for some common reasons and solutions. Include the entire stack trace
above this error message when asking for help.

Please Help me.

DeepCreamPy has been removed?

I noticed that the author of DeepCreamPy emptied his Github account and also logged out of Twitter, did something happen?

Colab version for detecting and masking images only?

Long story short when I use the main.exe file to detect/mask batch of images my cpu temp goes hot to the 80Cs and I want to avoid this, so is there a guide on how to use the colab version on just detecting and masking the images? And after that download the detected/masked images and use DCP to decensor it.

No CUDA-compatible GPU found.

2020-06-02 01:11:58.680066: I T:\src\github\tensorflow\tensorflow\core\platform\cpu_feature_guard.cc:140] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2
No CUDA-compatible GPU found.

How can I fix this and get it working on my GPU?
My GPU is GTX1080 and I have Cuda v9.0 with CuDNN 7.6.4 installed

Out of Memory

I used ESRGAN Mode. But I can't use this..

CUDA-compatible GPU located!
Starting ESRGAN detection and decensor
Model warmup complete
Exception in Tkinter callback
Traceback (most recent call last):
File "C:\Anaconda3\envs\deeplearning\lib\tkinter_init_.py", line 1705, in call
return self.func(*args)
File "main.py", line 311, in
go_button = Button(mos_win, text="Go!", command = lambda: hentAI_TGAN(in_path=o_entry.get(), is_video=False))
File "main.py", line 184, in hentAI_TGAN
detect_instance.run_ESRGAN(in_path = in_path, is_video = is_video, force_jpg = force_jpg)
File "C:\Users\power\Desktop\Project\Dev\GoodbyeForeignLangAndCensored\hent-AI\detector.py", line 379, in run_ESRGAN
self.resize_GAN(img_path=img_path, img_name=img_name, is_video=is_video)
File "C:\Users\power\Desktop\Project\Dev\GoodbyeForeignLangAndCensored\hent-AI\detector.py", line 220, in resize_GAN
self.esrgan_instance.run_esrgan(test_img_folder=file_name, out_filename=gan_img_path, mosaic_res=granularity)
File "C:\Users\power\Desktop\Project\Dev\GoodbyeForeignLangAndCensored\hent-AI\ColabESRGAN\test.py", line 49, in run_esrgan
output = self.model(img_LR).data.squeeze().float().cpu().clamp_(0, 1).numpy()
File "C:\Anaconda3\envs\deeplearning\lib\site-packages\torch\nn\modules\module.py", line 477, in call
result = self.forward(*input, **kwargs)
File "C:\Users\power\Desktop\Project\Dev\GoodbyeForeignLangAndCensored\hent-AI\ColabESRGAN\block.py", line 83, in forward
output = x + self.sub(x)
File "C:\Anaconda3\envs\deeplearning\lib\site-packages\torch\nn\modules\module.py", line 477, in call
result = self.forward(*input, **kwargs)
File "C:\Anaconda3\envs\deeplearning\lib\site-packages\torch\nn\modules\container.py", line 91, in forward
input = module(input)
File "C:\Anaconda3\envs\deeplearning\lib\site-packages\torch\nn\modules\module.py", line 477, in call
result = self.forward(*input, **kwargs)
File "C:\Users\power\Desktop\Project\Dev\GoodbyeForeignLangAndCensored\hent-AI\ColabESRGAN\block.py", line 229, in forward
out = self.RDB3(out)
File "C:\Anaconda3\envs\deeplearning\lib\site-packages\torch\nn\modules\module.py", line 477, in call
result = self.forward(*input, **kwargs)
File "C:\Users\power\Desktop\Project\Dev\GoodbyeForeignLangAndCensored\hent-AI\ColabESRGAN\block.py", line 207, in forward
x5 = self.conv5(torch.cat((x, x1, x2, x3, x4), 1))
RuntimeError: CUDA error: out of memory

Failed to execute script main (8004)

The error shows and disappear so fast, I can only capture this. I followed every steps in the tutorial file, runs as admin, no luck. Total noob, please help.
error

It doesn't work at all

First of all, I'm new to github. I'm not much of a programmer myself. So please let me know if I should do anything differently.

Windows 10-64bit
i5-6400
RX570

I followed all the instructions. Got the latest weights.h5, got 4x_FatalPixels_340000_G.pth.
When It runs it seems to work and says I can run deepcreampy but it doesn't make any output with green over the censors. It puts the original into the input_original folder but that's about it. I've attached my test image.

On a side note, does this work with GIFs? Maybe with the video option? I tried testing this one and it didn't work either.

[20312] Failed to execute script 'main' due to unhandled exception!

Disclaimer, I do not know python, I never used it so this post maybe considered stupid but I need any help I can get so...

Traceback (most recent call last):
  File "main.py", line 15, in <module>
    from detector import Detector
  File "PyInstaller\loader\pyimod03_importers.py", line 495, in exec_module
  File "detector.py", line 12, in <module>
    import numpy as np
ModuleNotFoundError: No module named 'numpy'
[20312] Failed to execute script 'main' due to unhandled exception!

I've installed numpy on my pc using pip but this is still the error I get

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.