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

How to disable spam? #147

Open
ShamHyper opened this issue Nov 6, 2023 · 7 comments
Open

How to disable spam? #147

ShamHyper opened this issue Nov 6, 2023 · 7 comments

Comments

@ShamHyper
Copy link

Dear dev!

I would really like to know if there is an option to disable this kind of messages in the console during predict.classify():

C:\...\photo.jpg size: (224, 224)
1/1 [==============================] - 0s 33ms/step

Icecream has a kind of prints switch ic.disable() | ic.enable(). Do you have a similar function? If not, then I will bypass this spam through std, but maybe you can help me?

@colindean
Copy link
Collaborator

According to this SO post, you should be able to pass verbose=0 in the args to model.predict(), which this library passes via the predict_args arg of classify(), e.g.

predict.classify(classify(model, input_paths, predict_args={verbose: 0})

If that works for you, please confirm and close this issue!

@ShamHyper
Copy link
Author

Uh...
TypeError: classify() got an unexpected keyword argument 'predict_args'

My code:
result = predict.classify(model_nsfw, file_path, predict_args={verbose: 0})
And "verbose" is not defined.

@ShamHyper ShamHyper reopened this Nov 11, 2023
@ShamHyper
Copy link
Author

ShamHyper commented Nov 11, 2023

Idk... but after reading code of predict.py, I don't understand how these arguments are passed to keras, and why in your example, after predict.classify, there is another classify in parentheses

According to this SO post, you should be able to pass verbose=0 in the args to model.predict(), which this library passes via the predict_args arg of classify(), e.g.

predict.classify(classify(model, input_paths, predict_args={verbose: 0})

If that works for you, please confirm and close this issue!

It seems that the classify() function does not accept a predict_args parameter 😣

@colindean
Copy link
Collaborator

why in your example, after predict.classify, there is another classify in parentheses

Probably a copy paste error. Take out the second function call

@ShamHyper
Copy link
Author

ShamHyper commented Nov 11, 2023

predict.classify(model_nsfw, file_path, predict_args={verbose: 0})

This right?

@colindean
Copy link
Collaborator

Looks to be, I can't try it right now

@ShamHyper
Copy link
Author

Waiting for dev's answer..

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

2 participants