summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJules Laplace <julescarbon@gmail.com>2019-01-15 19:40:02 +0100
committerJules Laplace <julescarbon@gmail.com>2019-01-15 19:40:02 +0100
commit8e06e61f3fd4cfab3f16f66e186abeee7a4cabf1 (patch)
treeb2324111e8abfc5717e96e6c752648f37c804f39
parent1e545a8a40b289123570ade0dd871c2beb1e43d2 (diff)
dir
-rw-r--r--crop_frames.py3
-rw-r--r--test.py10
2 files changed, 6 insertions, 7 deletions
diff --git a/crop_frames.py b/crop_frames.py
index 2462e7b..7f42d47 100644
--- a/crop_frames.py
+++ b/crop_frames.py
@@ -9,7 +9,6 @@ from PIL import Image
parser = argparse.ArgumentParser()
parser.add_argument('--step', default=256, type=int)
parser.add_argument('--overlap', default=2, type=int)
-parser.add_argument('--scale', default=4, type=int)
parser.add_argument('--in_dir', help='Directory to process')
parser.add_argument('--out_dir', default='crops', help='Directory to output to')
args = parser.parse_args()
@@ -19,7 +18,7 @@ def crop_dir():
overlap = args.overlap
side = step + overlap * 2
files = glob.glob('{}/*.png'.format(args.in_dir))
- print(files)
+ # print(files)
img = Image.open(files[0])
width, height = img.size
diff --git a/test.py b/test.py
index 57779ff..3b3db01 100644
--- a/test.py
+++ b/test.py
@@ -17,9 +17,9 @@ parser = argparse.ArgumentParser()
parser.add_argument('--L', metavar='L', type=int, default=choice([16, 28, 52]), help='Network depth: One of 16, 28, 52')
parser.add_argument('--T', metavar='T', default='L', help='Input type: L(Low-resolution) or G(Ground-truth)')
parser.add_argument('--in_dir', metavar='in_dir', default=None, help='Directory to process')
-parser.add_argument('--out_dir', metavar='out_dir', default='/media/blue/uprez', help='Directory to output to')
+parser.add_argument('--out_dir', metavar='out_dir', default='/media/blue/uprez/results', help='Directory to output to')
parser.add_argument('--network_dir', default='.', help='Path to networks')
-parser.add_argument('--no_mov', action='store_true')
+parser.add_argument('--mov_from_dirs', action='store_true')
args = parser.parse_args()
# Size of input temporal radius
@@ -46,13 +46,13 @@ def process_dir(dir):
dataset = dir_partz[-2]
part = dir_partz[-1]
tag = '_'.join([dataset, str(args.L) + 'L', part])
- out_path = os.path.join(args.out_dir, 'results', dataset, str(args.L) + 'L', part)
+ out_path = os.path.join(args.out_dir, dataset, str(args.L) + 'L', part)
render_path = os.path.join(args.out_dir, 'renders')
os.makedirs(out_path, exist_ok=True)
os.makedirs(render_path, exist_ok=True)
dir_frames = sorted(glob.glob(os.path.join(dir, '*.png')))
- print(dir_frames)
+ # print(dir_frames)
frames = []
for f in dir_frames:
@@ -70,7 +70,7 @@ def process_dir(dir):
Image.fromarray(np.around(out_H[0,0]*255).astype(np.uint8)).save('{}/frame_{:05d}.png'.format(out_path, i+1))
- if not args.no_mov:
+ if args.mov_from_dirs:
subprocess.call([
'ffmpeg',
'-hide_banner',