Page 1 of 1

Exception thrown during alignment cleanup: IndexError: list index out of range

Posted: Tue May 09, 2023 10:42 pm
by testarogue

Hi,

When I have run the following workflow:
Extract (batch, identity)
Sort (batch, face, face)
Manual cleanup of folders
Move desired PNGs to the parent folder
Alignment (remove-faces)

I end up with the following error:

Code: Select all

Traceback (most recent call last):
  File "C:\Users\Admin\faceswap\lib\cli\launcher.py", line 230, in execute_script
    process.process()
  File "C:\Users\Admin\faceswap\tools\alignments\alignments.py", line 239, in process
    self._run_process(args)
  File "C:\Users\Admin\faceswap\tools\alignments\alignments.py", line 214, in _run_process
    tool.process()
  File "C:\Users\Admin\faceswap\tools\alignments\alignments.py", line 314, in process
    job.process()
  File "C:\Users\Admin\faceswap\tools\alignments\jobs_faces.py", line 363, in process
    self._update_png_headers()
  File "C:\Users\Admin\faceswap\tools\alignments\jobs_faces.py", line 401, in _update_png_headers
    face.from_alignment(self._alignments.get_faces_in_frame(frame)[new_index])
IndexError: list index out of range

Error log:
List of files in faces directory:

Please let me know if you need any additional information to debug the issue.

Thanks a bunch


Re: Exception thrown during alignment cleanup: IndexError: list index out of range

Posted: Wed May 10, 2023 4:42 pm
by torzdf

Hmmmm, I thought this bug had been fixed, so it must be quite edge-case at this point (I recently ran extraction, with a very similar workflow to yours, over hundreds of videos).

As I'm unlikely to be able to fix this without being able to recreate, would it be possible for you to repeat the process, then zip up the faces folder + original alignments file and provide to me in their state just before running 'remove-faces' so I can recreate and look to implement a fix.


Re: Exception thrown during alignment cleanup: IndexError: list index out of range

Posted: Wed May 10, 2023 10:52 pm
by testarogue

Sure thing. I've uploaded the requested files here:

 ! Message from: torzdf

Files retrieved. Link removed


Re: Exception thrown during alignment cleanup: IndexError: list index out of range

Posted: Thu May 11, 2023 11:01 am
by torzdf

Ok, the reason you are hitting this error is that it looks like you have moved faces out of the aligner filter folders and into your main folder. You cannot do this. Faces which have been filtered out do not exist in the alignments file, hence when the process tries to remove the face from the alignments file, it can't find it and you hit an error.

If you want to keep some faces from the filtered out folder, you will need to regenerate an alignments file. You can do this by having all the faces you want to keep in a single folder and run the alignment tool from-faces job.

It's worth noting that faces which have been filtered out but look ok, probably have bad landmarks, and by chance happen to look correct visually.