twanghcmut's picture
download
raw
651 Bytes
from diffsynth.metrics import AestheticMetric, ModelConfig
from modelscope import dataset_snapshot_download
from PIL import Image
dataset_snapshot_download(
"DiffSynth-Studio/diffsynth_example_dataset",
allow_file_pattern="flux/FLUX.1-dev/*",
local_dir="./data/diffsynth_example_dataset",
)
image = Image.open("data/diffsynth_example_dataset/flux/FLUX.1-dev/1.jpg").convert("RGB")
metric = AestheticMetric.from_pretrained(
model_config=ModelConfig(model_id="DiffSynth-Studio/ImageMetrics", origin_file_pattern="Aesthetic/model.safetensors"),
device="cuda"
)
score = metric.compute(image)[0]
print(f"Aesthetic score: {score:.3f}")

Xet Storage Details

Size:
651 Bytes
·
Xet hash:
c2243f2fea55b718e7bd6ba7ec333c0081674489dd5cf5fc3b4c115849473741

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.