pyiqa.archs.laion_aes_arch ========================== .. py:module:: pyiqa.archs.laion_aes_arch .. autoapi-nested-parse:: LAION-Aesthetics Predictor Introduced by: https://github.com/christophschuhmann/improved-aesthetic-predictor Module Contents --------------- .. py:data:: default_model_urls .. py:class:: MLP(input_size, xcol='emb', ycol='avg_rating') Bases: :py:obj:`torch.nn.Module` Regression head used by LAION-Aesthetics predictor. .. py:method:: forward(x) Predict scalar aesthetics score from normalized image embeddings. .. py:class:: LAIONAes(pretrained=True, pretrained_model_path=None) Bases: :py:obj:`torch.nn.Module` LAION-Aesthetics predictor based on CLIP ViT-L/14 embeddings. :param pretrained: Whether to load pretrained MLP weights. :type pretrained: bool :param pretrained_model_path: Optional local checkpoint path. :type pretrained_model_path: str | None .. py:method:: forward(x) Predict aesthetics score. :param x: Input tensor with shape ``(N, 3, H, W)``. :type x: torch.Tensor :returns: Predicted score tensor with shape ``(N, 1)``. :rtype: torch.Tensor