opennsfw2

Keras implementation of the Yahoo Open-NSFW model

MIT License

Downloads
208.1K
Stars
354
Committers
1

Bot releases are hidden (Show)

opennsfw2 - 0.13.10 Latest Release

Published by bhky 2 months ago

  • Fix image overlay for GradCAM when using YAHOO preprocessing. The YAHOO preprocessing actually excludes from the model input certain pixels from each edge of the image, the GradCAM visualisation should take this into account.
opennsfw2 - 0.13.9

Published by bhky 3 months ago

  • Fix type annotation for PIL.Image.Image.
  • Use a fixed layer name global_average_pooling2d for the GlobalAveragePooling2D layer, to avoid Keras assigning a different name upon multiple model instantiations.
opennsfw2 - 0.13.7

Published by bhky 10 months ago

  • For Keras 2 compatibility, a generic type var KerasTensor is defined instead of using keras.KerasTensor directly, as the latter is only available in Keras 3.
  • Relax version requirement for Keras in setup config
opennsfw2 - 0.13.4

Published by bhky 10 months ago

  • Allow passing a model name to the make_open_nsfw_model function. This will be used as the name attribute of the returned Keras model object. The default name is opennsfw2.
  • Fix logic for updating the internal global model variable.
opennsfw2 - 0.13.2

Published by bhky 10 months ago

  • Use Keras 3 instead of Keras Core
  • Drop support for Python 3.8; add support for Python 3.11
opennsfw2 - 0.12.1

Published by bhky 11 months ago

  • Improve internal batching logic for predicting from image paths.
opennsfw2 - 0.12.0

Published by bhky 11 months ago

  • Improve support for using the APIs in a loop, in particular, reduce the memory usage due to re-creating the model object.
opennsfw2 - 0.11.0

Published by bhky about 1 year ago

  • Switch from tf.keras to keras_core
  • Include test run for JAX backend
  • Update README
  • Other minor fixes
opennsfw2 - 0.10.2

Published by bhky about 2 years ago

  • Fixed model inference usage to avoid potential TF mem-leak
opennsfw2 - 0.10.1

Published by bhky over 2 years ago

  • Remove grad_cam_height and grad_cam_width settings, the output grad-cam image will always be the same size as the input image
  • Default alpha is 0.8
opennsfw2 - 0.9.2

Published by bhky over 2 years ago

  • Add progress bar for predicting video frames.
  • Set all default batch sizes to 8.
opennsfw2 - 0.8.0

Published by bhky over 2 years ago

Add aggregation support for predicting video frames.

opennsfw2 - 0.7.0

Published by bhky almost 3 years ago

  • Drop support for Python 3.7.
  • Use numpy.typing from NumPy 1.22.0.
  • Use Pillow 9.0.0, note that this leads to some small floating point differences to the results.
  • Fix Grad-CAM tools.
opennsfw2 - 0.6.1

Published by bhky almost 3 years ago

Add matplotlib to required packages.

opennsfw2 - 0.6.0

Published by bhky almost 3 years ago

New features:

  • predict_image and predict_images can now also produce Grad-CAM plots that highlight the important regions which lead to the predictions.
opennsfw2 - 0.5.3

Published by bhky almost 3 years ago

Clean up code for model architecture to improve readability.

opennsfw2 - 0.5.2

Published by bhky almost 3 years ago

Fix mypy re-export errors

opennsfw2 - 0.5.1

Published by bhky almost 3 years ago

Save output video, if enabled, as MP4 instead of AVI.

opennsfw2 - 0.5.0

Published by bhky almost 3 years ago

New:

  • predict_video_frames for getting the NSFW probability of each video frame
  • predict_image for getting the NSFW probability of a single image

Breaking changes:

  • predict is removed, and replaced by predict_images, which returns a list of NSFW probabilities of the input images
opennsfw2 - 0.4.1

Published by bhky almost 3 years ago

Update dependencies.