Image Filters#
NeMo Curator provides filters for image curation, including aesthetic and NSFW filters. These models help you filter, score, and curate large image datasets for downstream tasks such as generative model training and dataset quality control.
How It Works#
Image filtering in NeMo Curator typically follows these steps:
Load images using
FilePartitioningStage
andImageReaderStage
Generate image embeddings using
ImageEmbeddingStage
Apply filtering stages (for example,
ImageAestheticFilterStage
orImageNSFWFilterStage
)Continue with further processing stages or save results
Filtering stages integrate seamlessly into NeMo Curator’s pipeline architecture.
Prerequisites#
Before using filtering stages, ensure that:
Load images using
ImageReaderStage
Generate image embeddings using
ImageEmbeddingStage
Populate the
ImageObject.embedding
field for each image
Imports#
from nemo_curator.stages.image.filters.aesthetic_filter import ImageAestheticFilterStage
from nemo_curator.stages.image.filters.nsfw_filter import ImageNSFWFilterStage
Available Filters#
Assess the subjective quality of images using a model trained on human aesthetic preferences. Filters images below a configurable aesthetic score threshold (0.0 to 1.0).
Detect not-safe-for-work (NSFW) content in images using a CLIP-based filter. Removes images above a configurable NSFW probability threshold (0.0 to 1.0).