nemo_curator.models.nsfw
Module Contents
Classes
Data
API
Bases: Module
NSFW detection model.
A neural network that processes CLIP embeddings to predict NSFW scores. Based on LAION’s CLIP-based-NSFW-Detector.
Forward pass through the NSFW model.
Parameters:
Input embeddings tensor.
Returns: torch.Tensor
NSFW probability scores.
Bases: ModelInterface
Public interface for NSFW scoring of image embeddings.
This class provides a standardized interface for scoring the likelihood of images containing sexually explicit material using a pre-trained model.
Get the name of the conda environment required for this model.
Get the model ID names associated with this NSFW scorer.
Score the NSFW likelihood of input embeddings.
Parameters:
Input embeddings as either a torch tensor or numpy array.
Returns: torch.Tensor
NSFW probability scores for each input embedding.
Download NSFW model weights from LAION repository.
Parameters:
Directory to download the weights to.
Set up the NSFW scoring model by loading weights.
Bases: Module
Normalization layer for NSFW model.
Applies normalization to input tensors using pre-computed mean and variance.
Apply normalization to input tensor.
Parameters:
Input tensor to normalize.
Returns: torch.Tensor
Normalized tensor.