nemo_curator.models.aesthetics

View as Markdown

Module Contents

Classes

NameDescription
AestheticScorerPublic interface for aesthetic scoring of video embeddings.
MLPMulti-layer perceptron.

Data

_AESTHETICS_MODEL_ID

_AESTHETICS_MODEL_REVISION

API

class nemo_curator.models.aesthetics.AestheticScorer(
model_dir: str
)

Bases: ModelInterface

Public interface for aesthetic scoring of video embeddings.

This class provides a standardized interface for scoring the aesthetic quality of video embeddings using a pre-trained model.

device
= 'cuda' if torch.cuda.is_available() else 'cpu'
dtype
= torch.float32
model_id_names
list[str]

Get the model ID names associated with this aesthetic scorer.

nemo_curator.models.aesthetics.AestheticScorer.__call__(
embeddings: torch.Tensor | numpy.typing.NDArray[numpy.float32]
) -> torch.Tensor

Score the aesthetics of input embeddings.

Parameters:

embeddings
torch.Tensor | npt.NDArray[np.float32]

Input embeddings as either a torch tensor or numpy array.

Returns: torch.Tensor

Aesthetic scores for each input embedding.

nemo_curator.models.aesthetics.AestheticScorer.download_weights_on_node(
model_dir: str
) -> None
classmethod

Download the weights for the aesthetic scorer on the node.

nemo_curator.models.aesthetics.AestheticScorer.get_weights_path() -> str

Get the path to the weights for the aesthetic scorer.

nemo_curator.models.aesthetics.AestheticScorer.setup() -> None

Set up the aesthetic scoring model by loading weights.

class nemo_curator.models.aesthetics.MLP()

Bases: Module

Multi-layer perceptron.

A neural network that processes embeddings to predict aesthetic scores.

layers
nemo_curator.models.aesthetics.MLP.forward(
embed: torch.Tensor
) -> torch.Tensor

Forward pass through the MLP.

Parameters:

embed
torch.Tensor

Input embeddings tensor.

Returns: torch.Tensor

Predicted aesthetic scores.

nemo_curator.models.aesthetics._AESTHETICS_MODEL_ID = 'ttj/sac-logos-ava1-l14-linearMSE'
nemo_curator.models.aesthetics._AESTHETICS_MODEL_REVISION = '1e77fa0'