mirror of
https://github.com/iperov/DeepFaceLab.git
synced 2025-07-05 20:42:11 -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.write ( struct.pack("Q", offset) )
|
||||||
of.seek(0,2)
|
of.seek(0,2)
|
||||||
of.close()
|
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"):
|
if as_person_faceset:
|
||||||
Path(filename).unlink()
|
for dir_name in io.progress_bar_generator(dir_names, "Deleting dirs"):
|
||||||
|
dir_path = samples_path / dir_name
|
||||||
if as_person_faceset:
|
try:
|
||||||
for dir_name in io.progress_bar_generator(dir_names, "Deleting dirs"):
|
shutil.rmtree(dir_path)
|
||||||
dir_path = samples_path / dir_name
|
except:
|
||||||
try:
|
io.log_info (f"unable to remove: {dir_path} ")
|
||||||
shutil.rmtree(dir_path)
|
|
||||||
except:
|
|
||||||
io.log_info (f"unable to remove: {dir_path} ")
|
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def unpack(samples_path):
|
def unpack(samples_path):
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue