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

The Extraction process failing on you, and you aren't getting an error back with clear instructions? Tell us about it here


Forum rules

Read the FAQs and search the forum before posting a new topic.

This forum is for reporting errors with the Extraction process. If you want to get tips, or better understand the Extract process, then you should look in the Extract Discussion forum.

Please mark any answers that fixed your problems so others can find the solutions.

Locked
User avatar
testarogue
Posts: 2
Joined: Tue May 09, 2023 10:27 pm

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

Post 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

Last edited by torzdf on Wed May 10, 2023 10:56 pm, edited 1 time in total.
User avatar
torzdf
Posts: 2649
Joined: Fri Jul 12, 2019 12:53 am
Answers: 159
Has thanked: 128 times
Been thanked: 622 times

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

Post 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.

My word is final

User avatar
testarogue
Posts: 2
Joined: Tue May 09, 2023 10:27 pm

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

Post by testarogue »

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

 ! Message from: torzdf

Files retrieved. Link removed

Last edited by torzdf on Wed May 10, 2023 10:54 pm, edited 1 time in total.
User avatar
torzdf
Posts: 2649
Joined: Fri Jul 12, 2019 12:53 am
Answers: 159
Has thanked: 128 times
Been thanked: 622 times

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

Post 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.

Last edited by torzdf on Thu May 11, 2023 11:03 am, edited 1 time in total.

My word is final

Locked