Skip to content
프로젝트

LAION-AI/aesthetic-predictor

GitHub에서 보기

소개

CLIP을 기반으로 이미지의 미적 품질을 예측하는 선형 추정기

기타 프로젝트

이 수치를 측정하는 방법

측정된 스타 증가

in 24h
0
in 7 days
0
in 15 days
+1
in 1 month
기록 수집 중

서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.

README.md

Original

LAION-Aesthetics_Predictor V1

Open In Colab

A linear estimator on top of clip to predict the aesthetic quality of pictures

Normal results:

Aesthetic results:

visualization over laion2B http://3080.rom1504.fr/aesthetic/aesthetic_viz.html

integrated into https://rom1504.github.io/clip-retrieval/

import os
import torch
import torch.nn as nn
from os.path import expanduser  # pylint: disable=import-outside-toplevel
from urllib.request import urlretrieve  # pylint: disable=import-outside-toplevel
def get_aesthetic_model(clip_model="vit_l_14"):
    """load the aethetic model"""
    home = expanduser("~")
    cache_folder = home + "/.cache/emb_reader"
    path_to_model = cache_folder + "/sa_0_4_"+clip_model+"_linear.pth"
    if not os.path.exists(path_to_model):
        os.makedirs(cache_folder, exist_ok=True)
        url_model = (
            "https://github.com/LAION-AI/aesthetic-predictor/blob/main/sa_0_4_"+clip_model+"_linear.pth?raw=true"
        )
        urlretrieve(url_model, path_to_model)
    if clip_model == "vit_l_14":
        m = nn.Linear(768, 1)
    elif clip_model == "vit_b_32":
        m = nn.Linear(512, 1)
    else:
        raise ValueError()
    s = torch.load(path_to_model)
    m.load_state_dict(s)
    m.eval()
    return m

That model takes clip embeddings as input

https://github.com/rom1504/embedding-reader/blob/main/examples/aesthetic_inference.py https://github.com/rom1504/embedding-reader/blob/main/examples/aesthetic_inference_emb.py

관련 프로젝트 살펴보기

불러오는 중…