GantMan / nsfw_model

Keras model of NSFW detector
Other
1.8k stars 279 forks source link

Is there a way to silence these messages? #113

Closed N4rral closed 1 year ago

N4rral commented 2 years ago

Everytime my script runs predict.classify() The console says: images/x.jpg size: (224, 224) 1/1 [==============================] - 1s 552ms/step It's not a big deal, but I would rather be without it. Is there a way to disable this?

GantMan commented 2 years ago

I can think of 2 ways.

  1. set the OS logger off.
  2. Add a flag to TF to set tf.get_logger().setLevel('INFO')
N4rral commented 2 years ago

I can think of 2 ways.

  1. set the OS logger off.
  2. Add a flag to TF to set tf.get_logger().setLevel('INFO')

Messing with loggers has no effect on this. If I understand it correctly, the messages are printed, not logged. I managed to modify the nsfw_detector module and remove the print(img_path, "size:", image_size) which got me rid of the images/x.jpg size: (224, 224) message, but the 1/1 [==============================] - 1s 552ms/step is still present and I don't see a print statement for that. I've even searched .py files from libraries that are imported in the nsfw_detector, but none of them has a print statement like that either. I have no idea where it comes from.