From 4524885253aafb9928e0859fb1505ce9c22ab06c Mon Sep 17 00:00:00 2001 From: Cameron Date: Tue, 11 Oct 2016 22:40:00 -0600 Subject: Added verbose to usage script --- neural_style.py | 8 ++++---- stylize_image.sh | 3 ++- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/neural_style.py b/neural_style.py index 2f9673f..b62de21 100644 --- a/neural_style.py +++ b/neural_style.py @@ -203,9 +203,9 @@ def parse_args(): args = parser.parse_args() # normalize weights - args.style_layer_weights = norm(args.style_layer_weights) - args.content_layer_weights = norm(args.content_layer_weights) - args.style_imgs_weights = norm(args.style_imgs_weights) + args.style_layer_weights = normalize(args.style_layer_weights) + args.content_layer_weights = normalize(args.content_layer_weights) + args.style_imgs_weights = normalize(args.style_imgs_weights) # create directories for output if args.video: @@ -534,7 +534,7 @@ def read_weights_file(path): weights = np.dstack([vals.astype(np.float32)] * 3) return weights -def norm(weights): +def normalize(weights): return [float(i)/sum(weights) for i in weights] def maybe_make_directory(dir_path): diff --git a/stylize_image.sh b/stylize_image.sh index 7c6f021..20e4ae9 100644 --- a/stylize_image.sh +++ b/stylize_image.sh @@ -40,4 +40,5 @@ python neural_style.py \ --content_img_dir "${content_dir}" \ --style_imgs "${style_filename}" \ --style_imgs_dir "${style_dir}" \ ---device "${device}"; \ No newline at end of file +--device "${device}" \ +--verbose; \ No newline at end of file -- cgit v1.2.3-70-g09d2