deepfakes / faceswap-playground

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

alignment tool file output crashes when the "folder" is a video file #296

Closed Kirin-kun closed 5 years ago

Kirin-kun commented 5 years ago

Just tried to find frames where there were multiple faces, with an alignments file and a video as input:

Loading...
Please backup your data and/or test the tool you want to use with a smaller data set to make sure you understand how it works.
06/30/2019 20:06:41 INFO     Log level set to: INFO
06/30/2019 20:06:42 INFO     [ALIGNMENT DATA]
06/30/2019 20:06:42 INFO     Reading alignments from: 'C:\Fakes\video\aligned.1\alignments.json'
06/30/2019 20:06:42 INFO     [FRAMES DATA]
06/30/2019 20:06:42 INFO     Loading video frames from C:\Users\Kirin\Desktop\video.mkv

06/30/2019 20:06:43 INFO     [CHECK FRAMES]
06/30/2019 20:06:43 INFO     Saving 7 result(s) to 'C:\Users\Kirin\Desktop\video.mkv\frames_with_multiple_faces_20190630_200643.txt'
06/30/2019 20:06:43 ERROR    Got Exception on main handler:\nTraceback (most recent call last):\n File "C:\Users\Kirin\faceswap\lib\cli.py", line 122, in execute_script\n process.process()\n File "C:\Users\Kirin\faceswap\tools\alignments.py", line 65, in process\n job.process()\n File "C:\Users\Kirin\faceswap\tools\lib_alignments\jobs.py", line 63, in process\n self.output_results(items_output)\n File "C:\Users\Kirin\faceswap\tools\lib_alignments\jobs.py", line 186, in output_results\n self.output_file(output_message, len(items_output))\n File "C:\Users\Kirin\faceswap\tools\lib_alignments\jobs.py", line 194, in output_file\n with open(output_file, "w") as f_output:\nFileNotFoundError: [Errno 2] No such file or directory: 'C:\\Users\\Kirin\\Desktop\\video.mkv\\frames_with_multiple_faces_20190630_200643.txt'
06/30/2019 20:06:43 CRITICAL An unexpected crash has occurred. Crash report written to 'C:\Users\Kirin\faceswap\crash_report.2019.06.30.200643527463.log'. Please verify you are running the latest version of faceswap before reporting
Process exited.

It tries to create a file in a "directory" with the same name as the video.

As for console output, it outputs blank lines:

Loading...
Please backup your data and/or test the tool you want to use with a smaller data set to make sure you understand how it works.
06/30/2019 20:11:20 INFO     Log level set to: INFO
06/30/2019 20:11:21 INFO     [ALIGNMENT DATA]
06/30/2019 20:11:21 INFO     Reading alignments from: 'C:\Fakes\video\aligned.1\alignments.json'
06/30/2019 20:11:22 INFO     [FRAMES DATA]
06/30/2019 20:11:22 INFO     Loading video frames from C:\Users\Kirin\Desktop\video.mkv

06/30/2019 20:11:22 INFO     [CHECK FRAMES]
06/30/2019 20:11:22 INFO     -----------------------------------------------
06/30/2019 20:11:22 INFO      Frames with multiple faces (7)
06/30/2019 20:11:22 INFO     -----------------------------------------------
06/30/2019 20:11:22 INFO     h
06/30/2019 20:11:22 INFO     h
06/30/2019 20:11:22 INFO     h
06/30/2019 20:11:22 INFO     h
06/30/2019 20:11:22 INFO     h
06/30/2019 20:11:22 INFO     h
06/30/2019 20:11:22 INFO     h
Process exited.
torzdf commented 5 years ago

Good catch. This should be fixed in latest commit.

Kirin-kun commented 5 years ago

Should be fixed.