From c0ccc57ea8224dd790149b155770a600cd801b3c Mon Sep 17 00:00:00 2001 From: deeppomf Date: Sun, 25 Feb 2018 09:47:43 -0500 Subject: [PATCH 1/2] better threshold value for mask --- train.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/train.py b/train.py index 767ab94..86d5be3 100644 --- a/train.py +++ b/train.py @@ -137,7 +137,7 @@ def get_points(): #rotate random amount between 0 and 90 degrees m = scipy.ndimage.rotate(m, np.random.random()*90, reshape = False) #set all elements greater than 0 to 1 - m[m > 0] = 1 + m[m > 0.5] = 1 mask.append(m) From 5b0f34f2e8f1e530d68f7cefb8f124005742d9ea Mon Sep 17 00:00:00 2001 From: deeppomf Date: Sun, 25 Feb 2018 09:56:51 -0500 Subject: [PATCH 2/2] train instructions --- README.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 61d1e32..20e3c4c 100644 --- a/README.md +++ b/README.md @@ -70,6 +70,10 @@ Decensored images will be saved to the "decensor_output_images" directory. Paste ## II. Train the pretrained model on custom dataset +You must have a GPU for training since training on a CPU will take weeks. + +Your custom dataset should be 128 x 128 images of uncensored vaginas and penises cropped from hentai. The more images, the better: I used 70,000 images for training. Censoring these images yourself is unnecessary. + Put your custom dataset for training in the "data/images" directory and convert images to npy format. ``` @@ -77,12 +81,14 @@ $ cd training_data $ python to_npy.py ``` -Train pretrained model on your custom dataset. +To train, run ``` $ python train.py ``` +If desired, you can train the pretrained model on your custom dataset. + Training can be done separately for mosaics with train_mosaic.py, but decensor.py is not yet compatible with mosaic decensorship models. # To do