mirror of
https://github.com/iperov/DeepFaceLab.git
synced 2025-07-08 05:51:40 -07:00
DFL-2.0 initial branch commit
This commit is contained in:
parent
52a67a61b3
commit
38b85108b3
154 changed files with 5251 additions and 9414 deletions
|
@ -5,10 +5,10 @@ import cv2
|
|||
|
||||
from DFLIMG import *
|
||||
from facelib import LandmarksProcessor
|
||||
from imagelib import IEPolys
|
||||
from interact import interact as io
|
||||
from utils import Path_utils
|
||||
from utils.cv2_utils import *
|
||||
from core.imagelib import IEPolys
|
||||
from core.interact import interact as io
|
||||
from core import pathex
|
||||
from core.cv2ex import *
|
||||
|
||||
|
||||
def save_faceset_metadata_folder(input_path):
|
||||
|
@ -19,7 +19,7 @@ def save_faceset_metadata_folder(input_path):
|
|||
io.log_info (f"Saving metadata to {str(metadata_filepath)}\r\n")
|
||||
|
||||
d = {}
|
||||
for filepath in io.progress_bar_generator( Path_utils.get_image_paths(input_path), "Processing"):
|
||||
for filepath in io.progress_bar_generator( pathex.get_image_paths(input_path), "Processing"):
|
||||
filepath = Path(filepath)
|
||||
dflimg = DFLIMG.load (filepath)
|
||||
|
||||
|
@ -52,7 +52,7 @@ def restore_faceset_metadata_folder(input_path):
|
|||
except:
|
||||
raise FileNotFoundError(filename)
|
||||
|
||||
for filepath in io.progress_bar_generator( Path_utils.get_image_paths(input_path), "Processing"):
|
||||
for filepath in io.progress_bar_generator( pathex.get_image_paths(input_path), "Processing"):
|
||||
filepath = Path(filepath)
|
||||
|
||||
shape, dfl_dict = d.get(filepath.name, None)
|
||||
|
@ -92,7 +92,7 @@ def remove_ie_polys_folder(input_path):
|
|||
|
||||
io.log_info ("Removing ie_polys...\r\n")
|
||||
|
||||
for filepath in io.progress_bar_generator( Path_utils.get_image_paths(input_path), "Removing"):
|
||||
for filepath in io.progress_bar_generator( pathex.get_image_paths(input_path), "Removing"):
|
||||
filepath = Path(filepath)
|
||||
remove_ie_polys_file(filepath)
|
||||
|
||||
|
@ -114,7 +114,7 @@ def remove_fanseg_folder(input_path):
|
|||
|
||||
io.log_info ("Removing fanseg mask...\r\n")
|
||||
|
||||
for filepath in io.progress_bar_generator( Path_utils.get_image_paths(input_path), "Removing"):
|
||||
for filepath in io.progress_bar_generator( pathex.get_image_paths(input_path), "Removing"):
|
||||
filepath = Path(filepath)
|
||||
remove_fanseg_file(filepath)
|
||||
|
||||
|
@ -150,14 +150,14 @@ def convert_png_to_jpg_folder (input_path):
|
|||
|
||||
io.log_info ("Converting PNG to JPG...\r\n")
|
||||
|
||||
for filepath in io.progress_bar_generator( Path_utils.get_image_paths(input_path), "Converting"):
|
||||
for filepath in io.progress_bar_generator( pathex.get_image_paths(input_path), "Converting"):
|
||||
filepath = Path(filepath)
|
||||
convert_png_to_jpg_file(filepath)
|
||||
|
||||
def add_landmarks_debug_images(input_path):
|
||||
io.log_info ("Adding landmarks debug images...")
|
||||
|
||||
for filepath in io.progress_bar_generator( Path_utils.get_image_paths(input_path), "Processing"):
|
||||
for filepath in io.progress_bar_generator( pathex.get_image_paths(input_path), "Processing"):
|
||||
filepath = Path(filepath)
|
||||
|
||||
img = cv2_imread(str(filepath))
|
||||
|
@ -179,7 +179,7 @@ def recover_original_aligned_filename(input_path):
|
|||
io.log_info ("Recovering original aligned filename...")
|
||||
|
||||
files = []
|
||||
for filepath in io.progress_bar_generator( Path_utils.get_image_paths(input_path), "Processing"):
|
||||
for filepath in io.progress_bar_generator( pathex.get_image_paths(input_path), "Processing"):
|
||||
filepath = Path(filepath)
|
||||
|
||||
dflimg = DFLIMG.load (filepath)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue