summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJules Laplace <julescarbon@gmail.com>2018-07-01 13:00:36 +0200
committerJules Laplace <julescarbon@gmail.com>2018-07-01 13:00:36 +0200
commitc86b54b92b70b8a19afa8bc756367dd44298562b (patch)
treedb1153d6e0f250f979f5e424ca677084200c7fbf
parentf726105ed0822e4b87926b080801c875d4d9c635 (diff)
padding
-rw-r--r--run.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/run.py b/run.py
index b059835..c589fab 100644
--- a/run.py
+++ b/run.py
@@ -85,7 +85,7 @@ def recurse_videos(moduleNetwork, tensorOutput, a, b, a_offset, b_offset, count,
b_fn = os.path.join(b, "frame_{:0>5}.png".format(int(frame_index + b_offset)))
print("{} => {}".format(a_fn, b_fn))
if not os.path.exists(a_fn) or not os.path.exists(b_fn):
- return [ None ]
+ return [ None ]
a_np = load_image(a_fn)
b_np = load_image(b_fn)
img_np = recurse_two_frames(moduleNetwork, tensorOutput, a_np, b_np, frame_index, count / 2, count / 4)
@@ -112,7 +112,7 @@ def average_two_videos(moduleNetwork, tensorOutput, a, b, a_offset, b_offset, st
b_fn = os.path.join(b, "frame_{:0>5}.png".format(int(i + b_offset)))
print("{} => {}".format(a_fn, b_fn))
if not os.path.exists(a_fn) and not os.path.exists(b_fn):
- continue
+ continue
a_np = load_image(a_fn)
b_np = load_image(b_fn)
tensorInputFirst = torch.FloatTensor(a_np)
@@ -176,8 +176,8 @@ def dilate_frames(moduleNetwork, tensorOutput, frames, dilate):
return new_frames
def store_frames(frames, outputPath, opt, inputFirst=None, inputSecond=None):
- if not outputPath.endsWith('.mp4'):
- outputPath += '.mp4'
+ if not outputPath.endsWith('.mp4'):
+ outputPath += '.mp4'
print('writing {}'.format(outputPath))
print('frames: {}'.format(len(frames)))
writer = FFMPEG_VideoWriter(outputPath, (1024, 512), FPS)