diff --git a/samplelib/PackedFaceset.py b/samplelib/PackedFaceset.py index 2ea01d9..e7ae1d4 100644 --- a/samplelib/PackedFaceset.py +++ b/samplelib/PackedFaceset.py @@ -84,17 +84,18 @@ class PackedFaceset(): of.write ( struct.pack("Q", offset) ) of.seek(0,2) of.close() + + if io.input_bool(f"Delete original files?", True): + for filename in io.progress_bar_generator(image_paths, "Deleting files"): + Path(filename).unlink() - for filename in io.progress_bar_generator(image_paths, "Deleting files"): - Path(filename).unlink() - - if as_person_faceset: - for dir_name in io.progress_bar_generator(dir_names, "Deleting dirs"): - dir_path = samples_path / dir_name - try: - shutil.rmtree(dir_path) - except: - io.log_info (f"unable to remove: {dir_path} ") + if as_person_faceset: + for dir_name in io.progress_bar_generator(dir_names, "Deleting dirs"): + dir_path = samples_path / dir_name + try: + shutil.rmtree(dir_path) + except: + io.log_info (f"unable to remove: {dir_path} ") @staticmethod def unpack(samples_path):