Exemplo n.º 1
0
    def extract(self, input_dir, output_dir, filter_path):
        extract = ExtractTrainingData(
            self._subparser, "extract", "Extract the faces from a pictures.")
        args_str = "extract***--input-dir***{}***--output-dir***{}***--processes***1***--detector***cnn***--filter***{}"

        args_str = args_str.format(input_dir, output_dir, filter_path)
        self._run_script(args_str)
Exemplo n.º 2
0
 def extract(self, input_dir, output_dir, filter_path, processes):
   extract = ExtractTrainingData(
     self._subparser, "extract", "Extract the faces from a pictures.")
   args_str = "extract --input-dir {} --output-dir {} --processes {} --detector cnn --filter {}"
   args_str = args_str.format(input_dir, output_dir, processes, filter_path)
   self._run_script(args_str)
Exemplo n.º 3
0
import sys
if  sys.version_info[0] < 3:
    raise Exception("This program requires at least python3.2")
if sys.version_info[0] == 3 and sys.version_info[1] < 2:
    raise Exception("This program requires at least python3.2")

from lib.utils import FullHelpArgumentParser

from scripts.extract import ExtractTrainingData
from scripts.train import TrainingProcessor
from scripts.convert import ConvertImage

from tensorflow.compat.v1 import ConfigProto
from tensorflow.compat.v1 import InteractiveSession

config = ConfigProto()
config.gpu_options.allow_growth = True
session = InteractiveSession(config=config)

if __name__ == "__main__":
    parser = FullHelpArgumentParser()
    subparser = parser.add_subparsers()
    extract = ExtractTrainingData(
        subparser, "extract", "Extract the faces from a pictures.")
    train = TrainingProcessor(
        subparser, "train", "This command trains the model for the two faces A and B.")
    convert = ConvertImage(
        subparser, "convert", "Convert a source image to a new one with the face swapped.")
    arguments = parser.parse_args()
    arguments.func(arguments)