diff options
| author | jules <jules@asdf.us> | 2018-11-30 16:29:28 +0100 |
|---|---|---|
| committer | jules <jules@asdf.us> | 2018-11-30 16:29:28 +0100 |
| commit | d709ed7333c3e5f53c35ece647ff2cb8bca94021 (patch) | |
| tree | 9cc5586ed9e18467c8a8ba02c4481b0ae0c2e280 /crop-equirectangular.py | |
| parent | 49dddb25080a5598618d59edc562f8f063a6f26e (diff) | |
dont clobber
Diffstat (limited to 'crop-equirectangular.py')
| -rw-r--r-- | crop-equirectangular.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/crop-equirectangular.py b/crop-equirectangular.py index d4f90f7..5927716 100644 --- a/crop-equirectangular.py +++ b/crop-equirectangular.py @@ -14,6 +14,7 @@ parser.add_argument('--folder', default="/media/ssd/sequences/venice_360/equi") parser.add_argument('--label', required=True) parser.add_argument('--vertical_offset', type=int, default=983) parser.add_argument('--overlap', type=float, default=0.5) +parser.add_argument('--clobber', action='store_false') opt = parser.parse_args() src_width = 4096 @@ -57,6 +58,8 @@ os.makedirs(path_1) os.makedirs(path_2) for i, fn in enumerate(glob.glob(os.path.join(opt.folder, '*.png'))): + if not opt.clobber and os.path.exists(path_0): + continue if (i % 100) == 0: print("{}...".format(i)) out_fn = "frame_{:05d}.png".format(i + 1) @@ -69,3 +72,4 @@ for i, fn in enumerate(glob.glob(os.path.join(opt.folder, '*.png'))): canvas.crop(p0).resize((1024, 512,), Image.ANTIALIAS).save(os.path.join(path_0, out_fn)) canvas.crop(p1).resize((1024, 512,), Image.ANTIALIAS).save(os.path.join(path_1, out_fn)) canvas.crop(p2).resize((1024, 512,), Image.ANTIALIAS).save(os.path.join(path_2, out_fn)) + |
