File size: 1,361 Bytes
bd00d6e
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# -*- coding: utf-8 -*-
"""
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")