Team-AY / FER-Landmarks

0 stars 0 forks source link

Landmarks crashes if no face / emotion detected in video #5

Open YakirHasid opened 3 weeks ago

YakirHasid commented 3 weeks ago

When finishing analysis with no face recognized / no emotion recognized the program crashes.

Traceback:

Exception in Tkinter callback Traceback (most recent call last): File "d:\Yakir\Development\Python\FaceRecognition\Research\FER-Landmarks.venv\Lib\site-packages\pandas\core\indexes\range.py", line 413, in get_loc return self._range.index(new_key) ^^^^^^^^^^^^^^^^^^^^^^^^^^ ValueError: 0 is not in range

The above exception was the direct cause of the following exception:

Traceback (most recent call last): File "C:\Users[REDACTED]\AppData\Local\Programs\Python\Python312\Lib\tkinter__init.py", line 1967, in call__ return self.func(*args) ^^^^^^^^^^^^^^^^ File "[REDACTED]\FER-Landmarks.venv\Lib\site-packages\customtkinter\windows\widgets\ctk_button.py", line 554, in _clicked self._command() File "[REDACTED]\FER-Landmarks\main-gui.py", line 125, in on_stop self.landmarks_class.quick_report(['bar', 'time']) File "[REDACTED]\FER-Landmarks\api\landmarks\landmarks.py", line 147, in quick_report emotions_df3 = emotions_df[0].map({'happy': 1, 'sad':2, 'neutral':3, 'surprise':4, 'angry':5, 'fear':6, 'disgust':7})


  File "[REDACTED]\FER-Landmarks\.venv\Lib\site-packages\pandas\core\frame.py", line 4102, in __getitem__
    indexer = self.columns.get_loc(key)
              ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "[REDACTED]\FER-Landmarks\.venv\Lib\site-packages\pandas\core\indexes\range.py", line 415, in get_loc
    raise KeyError(key) from err
KeyError: 0