From 795f81ad95888631420e870dfec6aaf7425cc598 Mon Sep 17 00:00:00 2001 From: jules Date: Fri, 23 Nov 2018 13:41:03 +0100 Subject: scripts --- .gitignore | 3 +++ cleanup.sh | 5 +++++ crop_frames.py | 4 ++-- today.sh | 23 +++++++++++++++++++++++ 4 files changed, 33 insertions(+), 2 deletions(-) create mode 100644 cleanup.sh create mode 100644 today.sh diff --git a/.gitignore b/.gitignore index ded016b..731c151 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,6 @@ results .DS_Store *.h5 +*.mp4 +*.png + diff --git a/cleanup.sh b/cleanup.sh new file mode 100644 index 0000000..8d1072a --- /dev/null +++ b/cleanup.sh @@ -0,0 +1,5 @@ +#!/bin/bash +rm -rf results/16L/L/* +rm -rf results/28L/L/* +rm -rf results/52L/L/* +rm -rf inputs/L/* diff --git a/crop_frames.py b/crop_frames.py index 8314816..516ad37 100644 --- a/crop_frames.py +++ b/crop_frames.py @@ -36,7 +36,7 @@ def crop_dir(): w = min(args.step, width - x) h = min(args.step, height - y) crop_dir = "{}/crop_{}_{}_{}_{}".format(args.dir, x, y, w, h) - print("{}x{} {}x{}".format(x, y, w, h)) + #print("{}x{} {}x{}".format(x, y, w, h)) crop = img.crop((x, y, x + w, y + h)) crop.save("{}/{}".format(crop_dir, fn)) @@ -108,4 +108,4 @@ if __name__ == "__main__": if args.cmd == 'crop': crop_dir() else: - merge_dir() \ No newline at end of file + merge_dir() diff --git a/today.sh b/today.sh new file mode 100644 index 0000000..aa7d7dd --- /dev/null +++ b/today.sh @@ -0,0 +1,23 @@ +#!/bin/bash + +python crop_frames.py --overlap 16 crop aquarium +rm -rf inputs/L/* +mv aquarium/crop* inputs/L/ +python test.py 28 L "" +python crop_frames.py merge results/28L/L/ +cd results/28L/L/merged/ +ffmpeg -i ./frame_%05d.png -y -c:v libx264 -vf fps=25 -pix_fmt yuv420p aquarium_uprez.mp4 +scp aquarium_uprez.mp4 jules@lmno:asdf/neural/uprez/ +cd ../../../../ +mv results/28L/L/ aquarium/uprez/ + +python crop_frames.py --overlap 16 crop venice +rm -rf inputs/L/* +mv venice/crop* inputs/L/ +python test.py 28 L "" +python crop_frames.py merge results/28L/L/ +cd results/28L/L/merged/ +ffmpeg -i ./frame_%05d.png -y -c:v libx264 -vf fps=25 -pix_fmt yuv420p venice_uprez.mp4 +scp venice_uprez.mp4 jules@lmno:asdf/neural/uprez/ +cd ../../../../ + -- cgit v1.2.3-70-g09d2