mirror of
https://github.com/iperov/DeepFaceLive
synced 2025-07-12 16:13:52 -07:00
_
This commit is contained in:
parent
8fc4447dab
commit
1d4d3cd0e8
3 changed files with 21 additions and 24 deletions
7
main.py
7
main.py
|
@ -54,10 +54,15 @@ def main():
|
|||
|
||||
def run_extract_FaceSynthetics(args):
|
||||
from scripts import dev
|
||||
dev.extract_FaceSynthetics(input_dir=args.input_dir)
|
||||
|
||||
inputdir_path = Path(args.input_dir)
|
||||
faceset_path = Path(args.faceset_path)
|
||||
|
||||
dev.extract_FaceSynthetics(inputdir_path, faceset_path)
|
||||
|
||||
p = dev_subparsers.add_parser('extract_FaceSynthetics')
|
||||
p.add_argument('--input-dir', default=None, action=fixPathAction, help="FaceSynthetics directory.")
|
||||
p.add_argument('--faceset-path', default=None, action=fixPathAction, help="output .dfs path")
|
||||
p.set_defaults(func=run_extract_FaceSynthetics)
|
||||
|
||||
train_parser = subparsers.add_parser( "train", help="Train neural network.")
|
||||
|
|
|
@ -26,7 +26,7 @@ def split_large_files(delete_original=False):
|
|||
SplittedFile.split(filepath, part_size=part_size, delete_original=delete_original)
|
||||
print('Done')
|
||||
|
||||
def extract_FaceSynthetics(input_dir):
|
||||
def extract_FaceSynthetics(inputdir_path : Path, faceset_path : Path):
|
||||
"""
|
||||
extract FaceSynthetics dataset https://github.com/microsoft/FaceSynthetics
|
||||
|
||||
|
@ -51,18 +51,10 @@ def extract_FaceSynthetics(input_dir):
|
|||
FACEWEAR = 18
|
||||
IGNORE = 255
|
||||
"""
|
||||
input_path = Path(input_dir)
|
||||
faceset_path = input_path.parent / f'{input_path.name}.dfs'
|
||||
if faceset_path.suffix != '.dfs':
|
||||
raise ValueError('faceset_path must have .dfs extension.')
|
||||
|
||||
# fs = lib_face.Faceset(output_dbpath)
|
||||
# for ufm in fs.iter_UFaceMark():
|
||||
# uimg = fs.get_UImage_by_uuid( ufm.get_UImage_uuid() )
|
||||
# img = uimg.get_image()
|
||||
|
||||
# cv2.imshow('', img)
|
||||
# cv2.waitKey(0)
|
||||
|
||||
filepaths = lib_path.get_files_paths(input_path)[:100] #TODO
|
||||
filepaths = lib_path.get_files_paths(inputdir_path)
|
||||
|
||||
fs = lib_face.Faceset(faceset_path)
|
||||
fs.recreate()
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
"""
|
||||
Job processing in subprocesses.
|
||||
Job lib using subprocesses
|
||||
"""
|
||||
|
||||
import multiprocessing
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue