deepfakes / faceswap-playground

User dedicated repo for the faceswap project
306 stars 194 forks source link

Cannot use alignemnts tool with 'no-faces' argument #205

Closed richard-bmc closed 5 years ago

richard-bmc commented 6 years ago

I tried to use tools.py with the following arguments:

python tools.py alignments -j no-faces -a \path\to\alignments.json -o file -fr path\to\frames\folder

But I got this error message:

[FACES DATA]
ERROR: The folder None could not be found

From the manual of tools.py, I should supply frame folder (-fr) argument, but the error message suggests that I should supply face folder (-fc), too. Is this correct? Besides, I checked the 'tools\alignments.py' file. In class Check, function get_source_dir():

    def get_source_dir(self, arguments):
        """ Set the correct source dir """
        if hasattr(arguments, "faces_dir"):
            self.type = "faces"
            source_dir = arguments.faces_dir
        elif hasattr(arguments, "frames_dir"):
            self.type = "frames"
            source_dir = arguments.frames_dir
        ......

The function checks if 'faces_dir' is one of the attribute of arguments, but doesn't check if it's None. In this case, the final value of self.type should be 'frames', and the return value (source_dir) should be what I supplied for '-fr' argument.

torzdf commented 6 years ago

Try latest staging commit.