mirror of
https://github.com/Deepshift/DeepCreamPy.git
synced 2025-01-08 12:36:43 +00:00
disable poisson blending
This commit is contained in:
parent
6a9e35820a
commit
4ed26b5d06
@ -33,8 +33,8 @@ Embarrassingly, because the neural network was trained to decensor horizontally
|
|||||||
- TensorFlow 1.5
|
- TensorFlow 1.5
|
||||||
- Pillow
|
- Pillow
|
||||||
- tqdm
|
- tqdm
|
||||||
- scipy
|
- scipy (only needed if poisson blending is enabled in decensor.py)
|
||||||
- pyamg
|
- pyamg (only needed if poisson blending is enabled in decensor.py)
|
||||||
- matplotlib (only for running test.py)
|
- matplotlib (only for running test.py)
|
||||||
|
|
||||||
Tested on Ubuntu 16.04. Cannot run on Windows since Tensorflow on Windows is for Python 3.
|
Tested on Ubuntu 16.04. Cannot run on Windows since Tensorflow on Windows is for Python 3.
|
||||||
|
@ -40,13 +40,13 @@ def decensor():
|
|||||||
for file in sorted(files):
|
for file in sorted(files):
|
||||||
file_path = os.path.join(subdir, file)
|
file_path = os.path.join(subdir, file)
|
||||||
if os.path.isfile(file_path) and os.path.splitext(file_path)[1] == ".png":
|
if os.path.isfile(file_path) and os.path.splitext(file_path)[1] == ".png":
|
||||||
print file_path
|
print(file_path)
|
||||||
image = Image.open(file_path).convert('RGB')
|
image = Image.open(file_path).convert('RGB')
|
||||||
image = np.array(image)
|
image = np.array(image)
|
||||||
image = np.array(image / 127.5 - 1)
|
image = np.array(image / 127.5 - 1)
|
||||||
x_decensor.append(image)
|
x_decensor.append(image)
|
||||||
x_decensor = np.array(x_decensor)
|
x_decensor = np.array(x_decensor)
|
||||||
print x_decensor.shape
|
print(x_decensor.shape)
|
||||||
step_num = int(len(x_decensor) / BATCH_SIZE)
|
step_num = int(len(x_decensor) / BATCH_SIZE)
|
||||||
|
|
||||||
cnt = 0
|
cnt = 0
|
||||||
@ -60,8 +60,9 @@ def decensor():
|
|||||||
img = np.array((img + 1) * 127.5, dtype=np.uint8)
|
img = np.array((img + 1) * 127.5, dtype=np.uint8)
|
||||||
original = x_batch[i]
|
original = x_batch[i]
|
||||||
original = np.array((original + 1) * 127.5, dtype=np.uint8)
|
original = np.array((original + 1) * 127.5, dtype=np.uint8)
|
||||||
output = blend(original, img, mask_batch[0,:,:,0])
|
#uncomment to enable poisson_blending, but poisson_blending doesn't seem to help
|
||||||
output = Image.fromarray(output.astype('uint8'), 'RGB')
|
#img = blend(original, img, mask_batch[0,:,:,0])
|
||||||
|
output = Image.fromarray(img.astype('uint8'), 'RGB')
|
||||||
dst = './decensor_output_images/{}.png'.format("{0:06d}".format(cnt))
|
dst = './decensor_output_images/{}.png'.format("{0:06d}".format(cnt))
|
||||||
output.save(dst)
|
output.save(dst)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user