mirror of
https://github.com/iperov/DeepFaceLab.git
synced 2025-07-05 12:36:42 -07:00
Faceset packer now asks whether to delete the original files
This commit is contained in:
parent
41b517517e
commit
766750941a
1 changed files with 11 additions and 10 deletions
|
@ -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):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue