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

Fail Gracefully when Deepbooru Can't Guess Tags #63

Open
testIgnor opened this issue Dec 11, 2024 · 0 comments
Open

Fail Gracefully when Deepbooru Can't Guess Tags #63

testIgnor opened this issue Dec 11, 2024 · 0 comments

Comments

@testIgnor
Copy link

Currently, if tags doesn't become populated, then the following code path is taken:

The following if statement prints a warning message with no other logic:

Because the else block is ignored, rating is not assigned a value before being referenced, causing the script to crash here:

This can be handled better by

  1. Providing a more informative error message. Perhaps something along the lines of f'Deepbooru could not guess tags for image! Maximum inference was {np.amax(results)}, while threshold is {threshold}!' Would also be helpful to print which image caused the error.
  2. Returning early within the if not tags block.
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

No branches or pull requests

1 participant