unix4artists/python/neural.sh

25 lines
496 B
Bash

#!/bin/bash
INPUT="${1}"
STYLE="${2}"
OUTPUT="${3}"
mkdir -p frames
mkdir -p neural-frames
ffmpeg -i "${INPUT}" frames/frame-%06d.png
FRAMES=frames/*.png
for frame in ${FRAMES}; do
echo "Running style transfer $frame -> neural-$frame ..."
bash python/style_transfer.sh "${frame}" "${STYLE}" "neural-${frame}"
done
sleep 10
ffmpeg -f image2 -i frames/neural-frame-%06d.png -c:v prores_ks -profile:v 3 "${OUTPUT}"
# cleanup frames directories when done
rm -rf frames
#rm -rf neural-frames