Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
deeppomf committed Feb 10, 2018
1 parent eb3c9c5 commit 76ed8a8
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 11 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# DeepMindBreak
Decensoring Hentai with Deep Neural Networks


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 for the algorithm to run.

# Limitations

Expand All @@ -15,9 +15,10 @@ It does NOT work with:
- Real life porn
- Mosaic censorship
- Censorship of nipples
- Complete censorship
- Animated gifs/videos

In particular, if a vagina or penis is completely censored out, THERE IS NO HOPE OF RECOVERY.

# Dependencies

- Python 2/3
Expand Down
2 changes: 1 addition & 1 deletion src/decensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def test():
sess.run(init_op)

saver = tf.train.Saver()
saver.restore(sess, '../saved_models/latest')
saver.restore(sess, '/saved_models/latest')

x_test = np.load(test_npy)
np.random.shuffle(x_test)
Expand Down
4 changes: 2 additions & 2 deletions src/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def test():
sess.run(init_op)

saver = tf.train.Saver()
saver.restore(sess, '../saved_models/latest')
saver.restore(sess, '/saved_models/latest')

x_test = np.load(test_npy)
np.random.shuffle(x_test)
Expand All @@ -50,7 +50,7 @@ def test():
masked = raw * (1 - mask_batch[i]) + np.ones_like(raw) * mask_batch[i] * 255
img = completion[i]
img = np.array((img + 1) * 127.5, dtype=np.uint8)
dst = './output/{}.jpg'.format("{0:06d}".format(cnt))
dst = '/output/{}.jpg'.format("{0:06d}".format(cnt))
output_image([['Input', masked], ['Output', img], ['Ground Truth', raw]], dst)


Expand Down
12 changes: 6 additions & 6 deletions src/train.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ def train():
init_op = tf.global_variables_initializer()
sess.run(init_op)

if tf.train.get_checkpoint_state('./saved_model'):
if tf.train.get_checkpoint_state('/saved_model'):
saver = tf.train.Saver()
saver.restore(sess, './saved_model/latest')
saver.restore(sess, '/saved_model/latest')

x_train, x_test = load.load()
x_train = np.array([a / 127.5 - 1 for a in x_train])
Expand Down Expand Up @@ -69,9 +69,9 @@ def train():


saver = tf.train.Saver()
saver.save(sess, './saved_model/latest', write_meta_graph=False)
saver.save(sess, '/saved_model/latest', write_meta_graph=False)
if sess.run(epoch) == PRETRAIN_EPOCH:
saver.save(sess, './saved_model/pretrained', write_meta_graph=False)
saver.save(sess, '/saved_model/pretrained', write_meta_graph=False)


# Discrimitation
Expand Down Expand Up @@ -106,10 +106,10 @@ def train():
x_batch = x_test[:BATCH_SIZE]
completion = sess.run(model.completion, feed_dict={x: x_batch, mask: mask_batch, is_training: False})
sample = np.array((completion[0] + 1) * 127.5, dtype=np.uint8)
cv2.imwrite('./output/{}.jpg'.format("{0:06d}".format(sess.run(epoch))), cv2.cvtColor(sample, cv2.COLOR_RGB2BGR))
cv2.imwrite('/output/{}.jpg'.format("{0:06d}".format(sess.run(epoch))), cv2.cvtColor(sample, cv2.COLOR_RGB2BGR))

saver = tf.train.Saver()
saver.save(sess, './saved_model/latest', write_meta_graph=False)
saver.save(sess, '/saved_model/latest', write_meta_graph=False)


def get_points():
Expand Down

0 comments on commit 76ed8a8

Please sign in to comment.