summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJules Laplace <julescarbon@gmail.com>2018-05-19 10:49:53 +0200
committerJules Laplace <julescarbon@gmail.com>2018-05-19 10:49:53 +0200
commit3ac5fa26a191dc27434c60a6fb48deae828b7c90 (patch)
tree4e993bedb0a389c23ca259dc66a2fe8a0caefa47
parentb7f45a7277152d5611f8f050243dd8d7c351979d (diff)
options for minimum recursion value
-rw-r--r--options/dataset_options.py14
-rw-r--r--test-mogrify-recursive.sh87
-rw-r--r--test-mogrify.py8
3 files changed, 96 insertions, 13 deletions
diff --git a/options/dataset_options.py b/options/dataset_options.py
index e1ef153..368f2b2 100644
--- a/options/dataset_options.py
+++ b/options/dataset_options.py
@@ -77,6 +77,20 @@ class DatasetOptions(BaseOptions):
### RECURSION
self.parser.add_argument(
+ '--transition-period',
+ default=3000,
+ type=int,
+ help='period of sine wave transition'
+ )
+
+ self.parser.add_argument(
+ '--transition-min',
+ default=1e-3,
+ type=float,
+ help='minimum amount of stabilization to apply'
+ )
+
+ self.parser.add_argument(
'--recursive',
action='store_true',
help='recurse on previous output'
diff --git a/test-mogrify-recursive.sh b/test-mogrify-recursive.sh
index 0986fb0..17e36af 100644
--- a/test-mogrify-recursive.sh
+++ b/test-mogrify-recursive.sh
@@ -30,34 +30,99 @@ how_many=2000
# --blur --canny \
# --norm batch
+ # python test-mogrify.py \
+ # --dataroot "/home/lens/Desktop/messi_ronaldo_256" \
+ # --start_img "/home/lens/Desktop/messi_ronaldo_256/frame_00001.png" \
+ # --experiment "messi_ronaldo" \
+ # --name woodscaled_4 \
+ # --recursive --recursive-frac 0.1 \
+ # --sequence --sequence-frac 0.3 \
+ # --process-frac 0.5 \
+ # --how_many 10000 --transition-period 1000 \
+ # --loadSize 256 --fineSize 256 \
+ # --model test --which_model_netG unet_256 \
+ # --which_direction AtoB --dataset_mode recursive \
+ # --which_epoch latest \
+ # --norm batch
+
+ python test-mogrify.py \
+ --dataroot "/home/lens/Desktop/venice" \
+ --start_img "/home/lens/Desktop/venice/frame_00001.png" \
+ --experiment "venice" \
+ --name venice \
+ --recursive --recursive-frac 0.1 \
+ --sequence --sequence-frac 0.3 \
+ --process-frac 0.5 \
+ --transition-min 0.001 \
+ --how_many 10000 --transition-period 1000 \
+ --loadSize 256 --fineSize 256 \
+ --model test --which_model_netG unet_256 \
+ --which_direction AtoB --dataset_mode recursive \
+ --which_epoch latest \
+ --norm batch
+
python test-mogrify.py \
- --dataroot "/home/lens/Desktop/venice_256" \
- --start_img "/home/lens/Desktop/venice_256/frame_00001.png" \
- --experiment "messi_ronaldo" \
- --name pcfade \
- --recursive --recursive-frac 0.2 \
+ --dataroot "/home/lens/Desktop/konigsheide" \
+ --start_img "/home/lens/Desktop/konigsheide/frame_00001.png" \
+ --experiment "konigsheide" \
+ --name konigsheide \
+ --recursive --recursive-frac 0.1 \
--sequence --sequence-frac 0.3 \
--process-frac 0.5 \
- --loadSize 256 --fineSize 256 --how_many 18000 \
+ --transition-min 0.01 \
+ --how_many 10000 --transition-period 1000 \
+ --loadSize 256 --fineSize 256 \
--model test --which_model_netG unet_256 \
--which_direction AtoB --dataset_mode recursive \
--which_epoch latest \
--norm batch
python test-mogrify.py \
- --dataroot "/home/lens/Desktop/walkermodified/walker5_256/" \
- --start_img "/home/lens/Desktop/walkermodified/walker5_256/frame_00001.png" \
- --experiment "messi_woodscaled4_r2_s5" \
- --name woodscaled_4 \
+ --dataroot "/home/lens/Desktop/venice" \
+ --start_img "/home/lens/Desktop/venice/frame_00001.png" \
+ --experiment "konigsheide" \
+ --name konigsheide \
--recursive --recursive-frac 0.1 \
--sequence --sequence-frac 0.3 \
--process-frac 0.5 \
- --loadSize 256 --fineSize 256 --how_many 2000 \
+ --transition-min 0.05 \
+ --how_many 10000 --transition-period 1000 \
+ --loadSize 256 --fineSize 256 \
--model test --which_model_netG unet_256 \
--which_direction AtoB --dataset_mode recursive \
--which_epoch latest \
--norm batch
+ python test-mogrify.py \
+ --dataroot "/home/lens/Desktop/konigsheide" \
+ --start_img "/home/lens/Desktop/konigsheide/frame_00001.png" \
+ --experiment "venice" \
+ --name venice \
+ --recursive --recursive-frac 0.1 \
+ --sequence --sequence-frac 0.3 \
+ --process-frac 0.5 \
+ --transition-min 0.01 \
+ --how_many 10000 --transition-period 1000 \
+ --loadSize 256 --fineSize 256 \
+ --model test --which_model_netG unet_256 \
+ --which_direction AtoB --dataset_mode recursive \
+ --which_epoch latest \
+ --norm batch
+
+ # python test-mogrify.py \
+ # --dataroot "/home/lens/Desktop/walkermodified/walker5_256/" \
+ # --start_img "/home/lens/Desktop/walkermodified/walker5_256/frame_00001.png" \
+ # --experiment "messi_woodscaled4_r2_s5" \
+ # --name woodscaled_4 \
+ # --recursive --recursive-frac 0.1 \
+ # --sequence --sequence-frac 0.3 \
+ # --process-frac 0.5 \
+ # --loadSize 256 --fineSize 256 --how_many 2000 \
+ # --model test --which_model_netG unet_256 \
+ # --which_direction AtoB --dataset_mode recursive \
+ # --which_epoch latest \
+ # --norm batch
+
# python test-mogrify.py \
# --dataroot "$dataset" \
# --start_img "$dataset/frame_00003.png" \
diff --git a/test-mogrify.py b/test-mogrify.py
index c1e0c71..68f279d 100644
--- a/test-mogrify.py
+++ b/test-mogrify.py
@@ -131,7 +131,6 @@ if __name__ == '__main__':
print("https://asdf.us/neural/" + video_fn)
-
if data_opt.mov:
render_video()
sys.exit(1)
@@ -194,6 +193,11 @@ if __name__ == '__main__':
image_pil.save(tmp_path)
os.rename(tmp_path, render_path)
+ def clamp(n,a,b):
+ return max(a, min(n, b))
+ def lerp(n,a,b):
+ return (b-a)*n+a
+
if dataset.name() == 'RecursiveDatasetDataLoader':
if data_opt.recursive and last_im is not None:
tmp_im = im.copy()
@@ -201,7 +205,7 @@ if __name__ == '__main__':
if data_opt.sequence and A_dir is not None:
A_img = Image.open(sequence_path).convert('RGB')
A_im = np.asarray(A_img)
- t = math.sin(i / 3000 * math.pi * 2 ) / 2 + 1
+ t = lerp(math.sin(i / data_opt.transition_period * math.pi * 2 ) / 2 + 1, data_opt.transition_min, 1.0)
frac_a = data_opt.recursive_frac * (1 - t)
frac_b = data_opt.sequence_frac * (1 - t)
frac_c = 1.0 - frac_a - frac_b