Skip to content
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

Improved Error Handling and Feedback in Face Recognition Module #167

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

benjisho
Copy link

@benjisho benjisho commented Dec 1, 2023

This pull request introduces several improvements to the face_recog.py.

Added checks and error handling for the if conditions, including:

  • When no face encodings are found.
  • When no match is found in the matches list.
  • When the face label does not match the expected label.
  • When the file specified by tmp_path does not exist.
  • When the operating system is not supported.

In addition, provided feedback to improve debugging process and visualizing the program flow.
These changes improve overall reliability and usability.

Added a check to verify that face encoding list is not empty before iterating it. - Prevents potential errors when trying to iterate empty list.

Also, added error message to be logged when no face is found.
Added a check to determine the operating system for setting file path delimiter. - If OS is not Windows, print error message.
Added else block to handle the case when no match is found in the `matches` list. - If no match found, print error message.

This helps in debugging and understanding when the face recognition fails to find a match.
Added `else` to handle when the face label does not match the expected label. - If the labels do not match, an error message printed.

This helps debugging and understanding when face recognition fails to find a match.
Added `else` to handle when file specified by `tmp_path` does not exist. - If file not exist, an error message printed.

This helps in debugging and understanding when the file remove operation fails due to file not being found.
Added a success message printed when face encodings are found.

This helps visualizing the flow of the program and confirms that the `loadKnown(label)` method has been called successfully before this point.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant