New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Getting Error: List index out of rage. While using detect_video(). Please help #155
Comments
I'm also faced with the same problem! |
Hi @Abid-S and @Ben-FCC, so sorry to hear about this. Any chance either of you could share one of your video files that is producing this error so that we can look into how to fix it? Feel free to email a link if you don't want to publicly share it on github to luke.j.chang@dartmouth.edu. Hopefully, we can resolve this quickly. |
Hi @ljchang, attached and sent a video to the above email. Thank you for your help. |
Apologies for the delay. This issue appears to arise when there is a discrepancy between faces detected using the face detector and pose detector when detecting image frames in a video. In the video @Abid-S sent me, there are frames in which all of the detectors find 2 faces, except for the pose detector, which only finds 1. @ejolly and @TiankangXie, there appear to be two different fixes for this on the
This is actually a pretty strange issue, which we do not have any type of test for yet. There are a number of potential solutions that warrant discussion before we can resolve this bug.
Curious to hear everyone's opinions on this before we spend too much time working on this problem. I will continue to play with the threshold part in the meantime. |
This definitely looks like it is related to
|
ok, just wanted to share an update. The issue for both @Abid-S and @Ben-FCC 's videos is very clearly caused by the default face detection threshold of 0.5. I arbitrarily moved it to 0.9. Honestly, I think we ought to entirely remove this from the package, but will leave it until I hear some discussion from @ejolly and @TiankangXie. I have started a PR #157 addressing these issues. |
I am using py-feat 0.5.0 pypi version and using detect_video function to extract features from video.
The program started successfully and in the middle of execution, its failing with the below error.
IndexError Traceback (most recent call last)
Input In [44], in <cell line: 7>()
11 print(f"Processing: {video}")
13 # This is the line that does detection!
---> 14 fex = detector.detect_video(video)
16 fex.to_csv(out_name, index=False)
File ~.conda\envs\LIE\lib\site-packages\feat\detector.py:802, in Detector.detect_video(self, video_path, skip_frames, output_size, batch_size, num_workers, pin_memory, **detector_kwargs)
800 frames = list(batch_data["Frame"].numpy())
801 landmarks = _inverse_landmark_transform(landmarks, batch_data)
--> 802 output = self._create_fex(
803 faces, landmarks, poses, aus, emotions, batch_data["FileName"], frames
804 )
805 batch_output.append(output)
807 batch_output = pd.concat(batch_output)
File ~.conda\envs\LIE\lib\site-packages\feat\detector.py:872, in Detector._create_fex(self, faces, landmarks, poses, aus, emotions, file_names, frame_counter)
856 for j, face_in_frame in enumerate(frame):
857 facebox_df = pd.DataFrame(
858 [
859 [
(...)
868 index=[j],
869 )
871 facepose_df = pd.DataFrame(
--> 872 [poses[i][j].flatten(order="F")],
873 columns=self.info["facepose_model_columns"],
874 index=[j],
875 )
877 landmarks_df = pd.DataFrame(
878 [landmarks[i][j].flatten(order="F")],
879 columns=self.info["face_landmark_columns"],
880 index=[j],
881 )
883 aus_df = pd.DataFrame(
884 aus[i][j, :].reshape(1, len(self["au_presence_columns"])),
885 columns=self.info["au_presence_columns"],
886 index=[j],
887 )
IndexError: list index out of range
The text was updated successfully, but these errors were encountered: