2021-05-09 16:55:14 +00:00
|
|
|
#!/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}"
|
|
|
|
|
2021-05-09 16:57:07 +00:00
|
|
|
# cleanup frames directories when done
|
|
|
|
rm -rf frames
|
2021-05-09 16:55:14 +00:00
|
|
|
#rm -rf neural-frames
|