summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJules Laplace <julescarbon@gmail.com>2018-11-29 21:04:10 +0100
committerJules Laplace <julescarbon@gmail.com>2018-11-29 21:04:10 +0100
commit7a048141e26fc399eea8d8eb254ebcd0f41c29a6 (patch)
tree15cc8de4177a2d4bec9b8bdd692a5c4d0078aa10
parent312d6022ff792497be93c0788c2c05be4cf41e8e (diff)
paths
-rw-r--r--crop-equirectangular.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/crop-equirectangular.py b/crop-equirectangular.py
index 47a56cd..16f19da 100644
--- a/crop-equirectangular.py
+++ b/crop-equirectangular.py
@@ -1,6 +1,7 @@
import os
import glob
import argparse
+from shutil import rmtree
from PIL import Image
# This script generates crops with a specific aspect ratio from a 360 video.
@@ -44,6 +45,17 @@ path_0 = os.path.join("sequences", opt.label + "_a")
path_1 = os.path.join("sequences", opt.label + "_b")
path_2 = os.path.join("sequences", opt.label + "_c")
+if os.path.exists(path_0):
+ rmtree(path_0)
+if os.path.exists(path_1):
+ rmtree(path_1)
+if os.path.exists(path_2):
+ rmtree(path_2)
+
+os.makedirs(path_0)
+os.makedirs(path_1)
+os.makedirs(path_2)
+
for i, fn in enumerate(glob.glob(os.path.join(opt.folder, '*.png'))):
fn = "frame_{:04d}.png".format(i)