aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpux <pux@pux.dom>2020-02-11 19:17:46 +0100
committerpux <pux@pux.dom>2020-02-11 19:17:46 +0100
commitdcccd74440ac048425866cb8839aab82cff952ed (patch)
tree06593a0b96f2fe5dd3a23a04aa634f0cd9192519
downloadnstvid-dcccd74440ac048425866cb8839aab82cff952ed.tar.gz
nstvid-dcccd74440ac048425866cb8839aab82cff952ed.tar.bz2
nstvid-dcccd74440ac048425866cb8839aab82cff952ed.zip
skel gooey proj, reference test script
-rw-r--r--nstvid.py21
-rw-r--r--nstvid.py.ref16
2 files changed, 37 insertions, 0 deletions
diff --git a/nstvid.py b/nstvid.py
new file mode 100644
index 0000000..53c443c
--- /dev/null
+++ b/nstvid.py
@@ -0,0 +1,21 @@
+#!/bin/env python
+
+from gooey import Gooey, GooeyParser
+
+@Gooey(default_size=(800, 600), terminal_font_color="FFFFFF",
+ header_bg_color="#000000")
+def init():
+ parser = GooeyParser(description = \
+ "nstvid - Neural Style Transfer Video Creator")
+ parser.add_argument("style_image", help="Style image", \
+ widget="FileChooser")
+ parser.add_argument("input_video", help="Source", widget="FileChooser")
+ params = parser.parse_args()
+ return params
+
+def main():
+ pass
+
+if __name__ == '__main__':
+ init()
+ main()
diff --git a/nstvid.py.ref b/nstvid.py.ref
new file mode 100644
index 0000000..bd526d9
--- /dev/null
+++ b/nstvid.py.ref
@@ -0,0 +1,16 @@
+#!/bin/env python
+
+import os
+import glob
+import sys
+
+os.chdir("/home/pux/p/nst_vid")
+for filename in sorted(glob.glob('image-*.jpg')):
+ num = filename[6:-4]
+ print(filename)
+ print(num)
+ os.chdir("/home/pux/src/neural-style-pt")
+
+ os.system("python neural_style.py -style_image /home/pux/p/nst_vid/style.jpg -content_image /home/pux/p/nst_vid/image-" + str(num) + ".jpg -output_image ~/p/nst_vid/generated-" + str(num) + ".jpg -image_size 384 -style_weight 1000 -content_weight 5 -cudnn_autotune -tv_weight 0.00085 -num_iterations 1000 -print_iter 50 -init image -optimizer lbfgs -learning_rate 1.0 -lbfgs_num_correction 100 -style_scale 1.0 -pooling max -backend cudnn -seed 100 -content_layers relu1_1,relu2_1,relu3_1,relu4_1,relu4_2,relu5_1 -style_layers relu3_1,relu4_1,relu4_2,relu5_1 -multidevice_strategy 4,7,29")
+
+ os.system("python opticalflow.py --input_1 /home/pux/p/nst_vid/image-" + str(num) + ".jpg --input_1_styled /home/pux/p/nst_vid/generated-" + str(num) + ".jpg --input_2 /home/pux/p/nst_vid/image-" + str(int(num)+1).zfill(5) + ".jpg --output /home/pux/p/nst_vid/blended-" + str(num) + ".jpg --alpha 0.55 --flowblend False")
in each repos: see "about"-tab (if existing) for more details / README.
mailto contact at omeckman dot net
all timestamps in UTC (German winter time: UTC+01:00, summer time: UTC+02:00)
dark theme is a modded version of: https://gist.github.com/Yoplitein/f4b671a2ec70c9e743fa