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

Handle ValueError exception in find #1039

Conversation

AndreaLanfranchi
Copy link
Contributor

When exctract_faces is invoked with enforce_detection == True is useful to treat the exception as a not found.

@serengil
Copy link
Owner

When I call find function, I want to see the error mentioning no face detected instead of empty list. You should do this exception handling where find function is called.

@serengil serengil closed this Feb 24, 2024
@AndreaLanfranchi
Copy link
Contributor Author

AndreaLanfranchi commented Feb 24, 2024

Gotcha.
However, for my knowledge, what is the point of throwing an exception on a function which finds ? An empty results set is more than enough (unless other errors occur). Eventually the function can be used as the inverse i.e. asserting there are no faces or no matches. It would be up the caller to decide how to treat the return result (not the callee to decide).
Just for the sake of knowledge...

@serengil
Copy link
Owner

Because empty list means that no matching face found. On the other hand, it can still find matching faces if you set enforce detection to false.

@AndreaLanfranchi AndreaLanfranchi deleted the al20240224-find-exception branch February 27, 2024 08:40
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.

2 participants