internal/ai/nsfw/README.md
Last Updated: December 23, 2025
internal/ai/nsfw runs the built-in TensorFlow NSFW classifier to score images for drawing, hentai, neutral, porn, and sexy content. It is used during indexing and metadata workflows when the NSFW model is enabled.
assets/models/ and resolves input/output ops (inferred if missing).Result struct for downstream thresholds and UI badges.TensorFlow tensors allocate C memory and are freed by Go GC finalizers. To keep RSS bounded during long runs, PhotoPrism periodically triggers garbage collection to return freed tensor memory to the OS. Tune with:
PHOTOPRISM_TF_GC_EVERY (default 200, 0 disables).saved_model.pb and variables/ exist under the model path.PHOTOPRISM_TF_GC_EVERY or reduce concurrent indexing load.internal/ai/vision/README.md — model registry and run schedulinginternal/ai/tensorflow/README.md — TensorFlow helpers, GC behavior, and model loading