|
|
|
""" |
|
Created on Wed Mar 13 14:03:54 2024 |
|
|
|
@author: rezer |
|
""" |
|
|
|
from sdeval.fidelity import CCIPMetrics |
|
from sdeval.controllability import BikiniPlusMetrics |
|
from sdeval.corrupt import AICorruptMetrics |
|
import os |
|
|
|
|
|
ccip = CCIPMetrics(images=r'jerry_test\train\1_1girl') |
|
bp = BikiniPlusMetrics( |
|
tag_blacklist=[ |
|
'bangs', 'long_hair', 'blue_eyes', 'animal_ears', 'sleeveless', |
|
'breasts', 'grey_hair', 'medium_breasts' |
|
] |
|
) |
|
metrics = AICorruptMetrics() |
|
lora_base_name_list=["surtr_arknights-000010", |
|
"surtr_arknights-000012", |
|
"surtr_arknights-000014", |
|
"surtr_arknights-000016", |
|
"surtr_arknights-000018", |
|
"surtr_arknights-000020", |
|
"surtr_arknights-000022", |
|
"surtr_arknights",] |
|
base_path=r'jerry_test' |
|
|
|
import pandas as pd |
|
l=[] |
|
for lora_base_name in lora_base_name_list: |
|
test_image_dir=os.path.join(base_path,lora_base_name) |
|
ccip_score=ccip.score( test_image_dir) |
|
metrics_score=metrics.score(test_image_dir) |
|
bp_score=bp.score(test_image_dir) |
|
score=[lora_base_name,ccip_score,metrics_score,bp_score] |
|
print(f"lora_name:{lora_base_name},ccip:{ccip_score},bp:{bp_score},AI-C:{metrics_score}") |
|
l.append(score) |
|
pd.DataFrame(l).to_excel("report.xlsx") |
|
|