diff options
Diffstat (limited to 'crop-equirectangular.py')
| -rw-r--r-- | crop-equirectangular.py | 12 |
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) |
