summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJules Laplace <julescarbon@gmail.com>2018-05-15 03:25:46 +0200
committerJules Laplace <julescarbon@gmail.com>2018-05-15 03:25:46 +0200
commit7d23842225e871366a77901471b365984db8ef79 (patch)
tree26fb3a127ccc580ba5cb2f0a2bd8e8717fa7a443
parent2f30ea306d5890cd904fb4a6d892fc1a4a4f67e6 (diff)
test
-rw-r--r--test-mogrify-recursive.sh115
-rw-r--r--test-mogrify.py31
2 files changed, 118 insertions, 28 deletions
diff --git a/test-mogrify-recursive.sh b/test-mogrify-recursive.sh
index d191c6a..7455c6f 100644
--- a/test-mogrify-recursive.sh
+++ b/test-mogrify-recursive.sh
@@ -1,6 +1,6 @@
recursive_frac=0.5
-tag='correct_rec${recursive_frac}'
+tag='spin'
dataset='/home/lens/Desktop/woods_videos/processed/dataset/B/'
how_many=200
@@ -16,27 +16,112 @@ python test-mogrify.py \
--recursive-frac $recursive_frac \
--norm batch
-python test-mogrify.py \
- --dataroot "$dataset/train/" \
- --start_img "$dataset/test/frame_00003.png" \
- --experiment "${tag}_dark_reverse" \
- --name pcfade \
- --loadSize 256 --fineSize 256 --how_many $how_many \
- --model test --which_model_netG unet_256 \
- --which_direction BtoA --dataset_mode recursive \
- --recursive --clahe --posterize --blur \
- --recursive-frac $recursive_frac \
- --norm batch
+# python test-mogrify.py \
+# --dataroot "$dataset/train/" \
+# --start_img "$dataset/test/frame_00003.png" \
+# --experiment "${tag}_dark_reverse" \
+# --name pcfade \
+# --loadSize 256 --fineSize 256 --how_many $how_many \
+# --model test --which_model_netG unet_256 \
+# --which_direction BtoA --dataset_mode recursive \
+# --recursive --clahe --posterize --blur \
+# --recursive-frac $recursive_frac \
+# --norm batch
+
+# python test-mogrify.py \
+# --dataroot "$dataset/train/" \
+# --start_img "$dataset/test/frame_01003.png" \
+# --experiment "${tag}_1003" \
+# --name pcfade \
+# --loadSize 256 --fineSize 256 --how_many $how_many \
+# --model test --which_model_netG unet_256 \
+# --which_direction AtoB --dataset_mode recursive \
+# --recursive --clahe --posterize --blur \
+# --recursive-frac $recursive_frac \
+# --norm batch
+
+# python test-mogrify.py \
+# --dataroot "$dataset/train/" \
+# --start_img "$dataset/test/frame_01003.png" \
+# --experiment "${tag}_1003_0_1frac" \
+# --name pcfade \
+# --loadSize 256 --fineSize 256 --how_many $how_many \
+# --model test --which_model_netG unet_256 \
+# --which_direction AtoB --dataset_mode recursive \
+# --recursive --clahe --posterize --blur \
+# --recursive-frac 0.1 \
+# --norm batch
+
+# python test-mogrify.py \
+# --dataroot "$dataset/train/" \
+# --start_img "$dataset/test/frame_01003.png" \
+# --experiment "${tag}_1003_0_8frac" \
+# --name pcfade \
+# --loadSize 256 --fineSize 256 --how_many $how_many \
+# --model test --which_model_netG unet_256 \
+# --which_direction AtoB --dataset_mode recursive \
+# --recursive --clahe --posterize --blur \
+# --recursive-frac 0.8 \
+# --norm batch
+
+# python test-mogrify.py \
+# --dataroot "$dataset/train/" \
+# --start_img "$dataset/test/frame_05003.png" \
+# --experiment "${tag}_5003" \
+# --name pcfade \
+# --loadSize 256 --fineSize 256 --how_many $how_many \
+# --model test --which_model_netG unet_256 \
+# --which_direction AtoB --dataset_mode recursive \
+# --recursive --clahe --posterize --blur \
+# --recursive-frac $recursive_frac \
+# --norm batch
+
+# python test-mogrify.py \
+# --dataroot "$dataset/train/" \
+# --start_img "$dataset/train/frame_05005.png" \
+# --experiment "${tag}_5005_rec_clahe_poster_blur" \
+# --name pcfade \
+# --loadSize 256 --fineSize 256 --how_many $how_many \
+# --model test --which_model_netG unet_256 \
+# --which_direction AtoB --dataset_mode recursive \
+# --recursive --clahe --posterize --blur \
+# --recursive-frac $recursive_frac \
+# --norm batch
+
+
+# python test-mogrify.py \
+# --dataroot "$dataset/train/" \
+# --start_img "$dataset/train/frame_05005.png" \
+# --experiment "${tag}_5005_rec_poster_blur" \
+# --name pcfade \
+# --loadSize 256 --fineSize 256 --how_many $how_many \
+# --model test --which_model_netG unet_256 \
+# --which_direction AtoB --dataset_mode recursive \
+# --recursive --posterize --blur \
+# --recursive-frac $recursive_frac \
+# --norm batch
+
+# python test-mogrify.py \
+# --dataroot "$dataset/train/" \
+# --start_img "$dataset/train/frame_05005.png" \
+# --experiment "${tag}_5005_rec_blur" \
+# --name pcfade \
+# --loadSize 256 --fineSize 256 --how_many $how_many \
+# --model test --which_model_netG unet_256 \
+# --which_direction AtoB --dataset_mode recursive \
+# --recursive --blur \
+# --recursive-frac $recursive_frac \
+# --norm batch
# python test-mogrify.py \
# --dataroot "$dataset/train/" \
-# --start_img "$dataset/B/test/frame_00003.png" \
-# --experiment "${tag}_dark" \
+# --start_img "$dataset/test/frame_10003.png" \
+# --experiment "${tag}_10003" \
# --name pcfade \
# --loadSize 256 --fineSize 256 --how_many $how_many \
# --model test --which_model_netG unet_256 \
# --which_direction AtoB --dataset_mode recursive \
-# --recursive --clahe --posterize \
+# --recursive --clahe --posterize --blur \
# --recursive-frac $recursive_frac \
# --norm batch
diff --git a/test-mogrify.py b/test-mogrify.py
index 7cb9f05..12e042e 100644
--- a/test-mogrify.py
+++ b/test-mogrify.py
@@ -14,6 +14,7 @@ from shutil import copyfile, rmtree
import numpy as np
import cv2
from datetime import datetime
+import re
import subprocess
from time import sleep
@@ -28,11 +29,11 @@ if __name__ == '__main__':
opt.experiment = data_opt.experiment # opt.start_img.split("/")[-1].split(".")[0]
d = datetime.now()
- tag = "{}_{}_{}_{}".format(
- opt.name, opt.experiment, data_opt.experiment,
+ tag = "{}_{}_{}".format(
+ opt.name, data_opt.experiment,
d.strftime('%Y%m%d%H%M'))
- opt.tag = tag = "pcfade___201805150250"
+ opt.tag = tag # = "pcfade___201805150250"
opt.render_dir = render_dir = opt.results_dir + opt.name + "/" + tag + "/"
@@ -47,6 +48,11 @@ if __name__ == '__main__':
copyfile(opt.start_img, render_dir + "frame_00000.png")
+ i_offset = 0
+ numz = re.findall(r'\d+', os.path.basename(opt.start_img))
+ if len(numz) > 0:
+ i_offset = int(numz[0])
+
data_loader = CreateRecursiveDataLoader(opt)
dataset = data_loader.load_data()
ds = dataset.dataset
@@ -89,7 +95,7 @@ if __name__ == '__main__':
array_b = np.multiply(last_im.astype('float64'), frac_b)
im = np.add(array_a, array_b).astype('uint8')
# print(im.shape, im.dtype)
- last_im = np.roll(tmp_im, 1, axis=1)
+ # last_im = np.roll(tmp_im, 1, axis=1)
else:
last_im = im.copy().astype('uint8')
tmp_im = im.copy().astype('uint8')
@@ -128,16 +134,15 @@ if __name__ == '__main__':
print(opt.render_dir)
video_fn = tag + "_mogrify.mp4"
- if data_opt.mov:
- cmd = ("ffmpeg", "-i", render_dir + "ren_%05d.png", "-y", "-c:v", "libx264", "-vf", "fps=30", "-pix_fmt", "yuv420p", "-s", "456x256", render_dir + video_fn)
- process = subprocess.Popen(cmd, stdout=subprocess.PIPE)
- output, error = process.communicate()
+ cmd = ("ffmpeg", "-i", render_dir + "ren_%05d.png", "-y", "-c:v", "libx264", "-vf", "fps=30", "-pix_fmt", "yuv420p", "-s", "456x256", render_dir + video_fn)
+ process = subprocess.Popen(cmd, stdout=subprocess.PIPE)
+ output, error = process.communicate()
- print("________")
+ print("________")
- cmd = ("scp", render_dir + video_fn, "jules@asdf.us:asdf/neural/")
- process = subprocess.Popen(cmd, stdout=subprocess.PIPE)
- output, error = process.communicate()
+ cmd = ("scp", render_dir + video_fn, "jules@asdf.us:asdf/neural/")
+ process = subprocess.Popen(cmd, stdout=subprocess.PIPE)
+ output, error = process.communicate()
- print("https://asdf.us/neural/" + video_fn)
+ print("https://asdf.us/neural/" + video_fn)