diff options
author | xAlpharax <42233094+xAlpharax@users.noreply.github.com> | 2023-02-27 22:44:09 +0200 |
---|---|---|
committer | xAlpharax <42233094+xAlpharax@users.noreply.github.com> | 2023-02-27 22:44:09 +0200 |
commit | bd19b46d7544ff94be0e8eaccb4e1bd18d44b996 (patch) | |
tree | 4ca021df24e00b9b8c4a219fa4dc8fea3f8d989a /stylize.sh | |
parent | 6fe8a3228e3170600b68d9b19e3b8f07e51222fe (diff) |
Multi-threaded renderer implemented successfully. Better error handling. Minor changes in multiple areas
Diffstat (limited to 'stylize.sh')
-rwxr-xr-x | stylize.sh | 26 |
1 files changed, 18 insertions, 8 deletions
@@ -1,25 +1,35 @@ -#!/bin/zsh +#!/bin/bash ### You must be in the 'neural-art' directory when you run this -if [ $# -eq 0 ] - then +cwd=$(pwd | sed -r 's%.*/%%g') +if [ $cwd != "neural-art" ] ; then + echo "You must be in the 'neural-art' directory when you run this" + exit 1 +fi + +if [ $# -eq 0 ] ; then echo "Style Image and Content Image need to be specified as arguments" echo "Example: ./stylize.sh Images/Jitter_Doll.jpg Images/cute.jpg" exit 1 fi -if [ $# -eq 1 ] - then - echo "Content image needs to be specified" +if [ $# -eq 1 ] ; then + echo "Content image needs to be specified as well" + echo "Example: ./stylize.sh Images/Jitter_Doll.jpg Images/cute.jpg" exit 1 fi +./clear_dir.sh + # stylize data [pair (style, content)] python neuralart.py $1 $2 # render images (actual frames) from (an) images.npy -python renderer.py $1 $2 +python renderer.py + +# render fix +python renderer.py --fix # turn everything into a video -ffmpeg -framerate 60 -pattern_type glob -i 'Output/neural_art_*.png' -vf "pad=ceil(iw/2)*2:ceil(ih/2)*2" ${${2/*\/}/.*}_in_${${1/*\/}/.*}.mp4 +ffmpeg -framerate 60 -pattern_type glob -i 'Output/neural_art_*.png' -vf "pad=ceil(iw/2)*2:ceil(ih/2)*2" $(basename ${2%.*})'_in_'$(basename ${1%.*})'.mp4' |