Spaces:
Running
Running
initial commit
Browse filesThis view is limited to 50 files because it contains too many changes.
See raw diff
- .streamlit/config.toml +10 -0
- README.md +13 -13
- main.py +89 -0
- static/DALLE_3/0.jpeg +0 -0
- static/DALLE_3/00001.jpeg +0 -0
- static/DALLE_3/00002.jpeg +0 -0
- static/DALLE_3/00003.jpeg +0 -0
- static/DALLE_3/00004.jpeg +0 -0
- static/DALLE_3/00005.jpeg +0 -0
- static/DALLE_3/00006.jpeg +0 -0
- static/DALLE_3/00007.jpeg +0 -0
- static/DALLE_3/00008.jpeg +0 -0
- static/DALLE_3/00009.jpeg +0 -0
- static/DALLE_3/00010.jpeg +0 -0
- static/DALLE_3/00011.jpeg +0 -0
- static/DALLE_3/00012.jpeg +0 -0
- static/DALLE_3/00013.jpeg +0 -0
- static/DALLE_3/00014.jpeg +0 -0
- static/DALLE_3/00015.jpeg +0 -0
- static/DALLE_3/00016.jpeg +0 -0
- static/DALLE_3/00017.jpeg +0 -0
- static/DALLE_3/00018.jpeg +0 -0
- static/DALLE_3/00019.jpeg +0 -0
- static/DALLE_3/00020.jpeg +0 -0
- static/DALLE_3/00021.jpeg +0 -0
- static/DALLE_3/00022.jpeg +0 -0
- static/DALLE_3/00023.jpeg +0 -0
- static/DALLE_3/00024.jpeg +0 -0
- static/DALLE_3/00025.jpeg +0 -0
- static/DALLE_3/00026.jpeg +0 -0
- static/DALLE_3/00027.jpeg +0 -0
- static/DALLE_3/00028.jpeg +0 -0
- static/DALLE_3/00029.jpeg +0 -0
- static/DALLE_3/00030.jpeg +0 -0
- static/DALLE_3/00031.jpeg +0 -0
- static/DALLE_3/00032.jpeg +0 -0
- static/DALLE_3/00033.jpeg +0 -0
- static/DALLE_3/00034.jpeg +0 -0
- static/DALLE_3/00035.jpeg +0 -0
- static/DALLE_3/00036.jpeg +0 -0
- static/DALLE_3/00037.jpeg +0 -0
- static/DALLE_3/00038.jpeg +0 -0
- static/DALLE_3/00039.jpeg +0 -0
- static/DALLE_3/00040.jpeg +0 -0
- static/DALLE_3/00041.jpeg +0 -0
- static/DALLE_3/00042.jpeg +0 -0
- static/DALLE_3/00043.jpeg +0 -0
- static/DALLE_3/00044.jpeg +0 -0
- static/DALLE_3/00045.jpeg +0 -0
- static/DALLE_3/00046.jpeg +0 -0
.streamlit/config.toml
ADDED
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
[server]
|
2 |
+
enableStaticServing = true
|
3 |
+
maxMessageSize = 2000
|
4 |
+
|
5 |
+
#[theme]
|
6 |
+
#primaryColor="#f5ebff"
|
7 |
+
#backgroundColor="#FFFFFF"
|
8 |
+
#secondaryBackgroundColor="#eff9ff"
|
9 |
+
#textColor="#1f2937"
|
10 |
+
#font="sans serif"
|
README.md
CHANGED
@@ -1,13 +1,13 @@
|
|
1 |
-
---
|
2 |
-
title:
|
3 |
-
emoji:
|
4 |
-
colorFrom:
|
5 |
-
colorTo:
|
6 |
-
sdk: streamlit
|
7 |
-
sdk_version: 1.35.0
|
8 |
-
app_file:
|
9 |
-
pinned: false
|
10 |
-
license: mit
|
11 |
-
---
|
12 |
-
|
13 |
-
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
|
|
1 |
+
---
|
2 |
+
title: Streamlit Leaderboard
|
3 |
+
emoji: ⚡
|
4 |
+
colorFrom: indigo
|
5 |
+
colorTo: green
|
6 |
+
sdk: streamlit
|
7 |
+
sdk_version: 1.35.0
|
8 |
+
app_file: main.py
|
9 |
+
pinned: false
|
10 |
+
license: mit
|
11 |
+
---
|
12 |
+
|
13 |
+
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
main.py
ADDED
@@ -0,0 +1,89 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import streamlit as st
|
2 |
+
import pandas as pd
|
3 |
+
import json
|
4 |
+
|
5 |
+
# 读取 JSON 数据
|
6 |
+
with open('GenAI-Bench_tags.json', 'r') as file:
|
7 |
+
data = json.load(file)
|
8 |
+
|
9 |
+
# Streamlit 页面标题
|
10 |
+
|
11 |
+
st.set_page_config(page_title="GenAI Bench Leaderboard", page_icon=None, layout="wide", initial_sidebar_state="auto",
|
12 |
+
menu_items=None)
|
13 |
+
st.title('GenAI Bench Leaderboard')
|
14 |
+
# 多选框
|
15 |
+
basic_options = []
|
16 |
+
advanced_options = []
|
17 |
+
|
18 |
+
for i in data:
|
19 |
+
data[i]['basic'].sort()
|
20 |
+
data[i]['advanced'].sort()
|
21 |
+
|
22 |
+
for basic in data[i]['basic']:
|
23 |
+
if basic not in basic_options:
|
24 |
+
basic_options.append(basic)
|
25 |
+
for adv in data[i]['advanced']:
|
26 |
+
if adv not in advanced_options:
|
27 |
+
advanced_options.append(adv)
|
28 |
+
data[i]['id'] = i
|
29 |
+
# modles = ["DALLE_3","DeepFloyd_I_XL_v1","Midjourney_6","SDXL_2_1","SDXL_Base","SDXL_Turbo"]
|
30 |
+
data[i]['DALLE_3'] = f"app/static/DALLE_3/{i}.jpeg"
|
31 |
+
data[i]['DeepFloyd_I_XL_v1'] = f"app/static/DeepFloyd_I_XL_v1/{i}.jpeg"
|
32 |
+
data[i]['Midjourney_6'] = f"app/static/Midjourney_6/{i}.jpeg"
|
33 |
+
data[i]['SDXL_2_1'] = f"app/static/SDXL_2_1/{i}.jpeg"
|
34 |
+
data[i]['SDXL_Base'] = f"app/static/SDXL_Base/{i}.jpeg"
|
35 |
+
data[i]['SDXL_Turbo'] = f"app/static/SDXL_Turbo/{i}.jpeg"
|
36 |
+
|
37 |
+
data[i]['DALLE_3_Human'] = -1
|
38 |
+
data[i]['DeepFloyd_I_XL_v1_Human'] = -1
|
39 |
+
data[i]['Midjourney_6_Human'] = -1
|
40 |
+
data[i]['SDXL_2_1_Human'] = -1
|
41 |
+
data[i]['SDXL_Base_Human'] = -1
|
42 |
+
data[i]['SDXL_Turbo_Human'] = -1
|
43 |
+
|
44 |
+
selected_basic = st.multiselect('Select Basic Skills:', basic_options)
|
45 |
+
selected_advanced = st.multiselect('Select Advanced Skills:', advanced_options)
|
46 |
+
|
47 |
+
# 筛选数据
|
48 |
+
filtered_data = [
|
49 |
+
data[item] for item in data
|
50 |
+
if all(elem in data[item]['basic'] for elem in selected_basic) and
|
51 |
+
all(advanced in data[item]['advanced'] for advanced in selected_advanced)
|
52 |
+
]
|
53 |
+
|
54 |
+
# 显示筛选后的数据
|
55 |
+
if filtered_data:
|
56 |
+
df = pd.DataFrame(filtered_data)
|
57 |
+
df = df.reindex(columns=["id", "prompt", "basic", "advanced", "DALLE_3", "DALLE_3_Human", "DeepFloyd_I_XL_v1",
|
58 |
+
"DeepFloyd_I_XL_v1_Human", "Midjourney_6", "Midjourney_6_Human", "SDXL_2_1",
|
59 |
+
"SDXL_2_1_Human", "SDXL_Base", "SDXL_Base_Human", "SDXL_Turbo", "SDXL_Turbo_Human"])
|
60 |
+
# df['pic'] = df['pic'].apply(lambda x: f'< img src="{x}" width="60">')
|
61 |
+
# st.write(df.to_html(escape=False), unsafe_allow_html=True)
|
62 |
+
st.dataframe(data=df, width = 4096, height = 800,
|
63 |
+
column_config={
|
64 |
+
"name": "Data Explorer",
|
65 |
+
"id": st.column_config.NumberColumn("ID", format="%d", width="small"),
|
66 |
+
'basic': st.column_config.ListColumn(label="Basic Skills", width="large", help=None),
|
67 |
+
'advanced': st.column_config.ListColumn(label="Advanced Skills", width="large", help=None),
|
68 |
+
'prompt': st.column_config.TextColumn(label="Prompt", width="large", help=None, disabled=None,
|
69 |
+
required=None,
|
70 |
+
default=None, max_chars=None, validate=None),
|
71 |
+
"DALLE_3": st.column_config.ImageColumn(label="DALLE_3", width="small", help=None),
|
72 |
+
"DAlle_3_Human": st.column_config.NumberColumn("Rating Human", format="%d", width="small", help="Rating Human for DALLE_3"),
|
73 |
+
"DeepFloyd_I_XL_v1": st.column_config.ImageColumn(label="DeepFloyd", width="small",
|
74 |
+
help="DeepFloyd_I_XL_v1"),
|
75 |
+
"DeepFloyd_I_XL_v1_Human": st.column_config.NumberColumn("Rating Human", format="%d",
|
76 |
+
width="small", help="Rating Human for DeepFloyd"),
|
77 |
+
"Midjourney_6": st.column_config.ImageColumn(label="Midjourney_6", width="small", help=None),
|
78 |
+
"Midjourney_6_Human": st.column_config.NumberColumn("Rating Human", format="%d",
|
79 |
+
width="small", help="Rating Human for Midjourney_6"),
|
80 |
+
"SDXL_2_1": st.column_config.ImageColumn(label="SDXL_2_1", width="small", help=None),
|
81 |
+
"SDXL_2_1_Human": st.column_config.NumberColumn("Rating Human", format="%d", width="small", help="Rating Human for SDXL_2_1"),
|
82 |
+
"SDXL_Base": st.column_config.ImageColumn(label="SDXL_Base", width="small", help=None),
|
83 |
+
"SDXL_Base_Human": st.column_config.NumberColumn("Rating Human", format="%d", width="small", help="Rating Human for SDXL_Base"),
|
84 |
+
"SDXL_Turbo": st.column_config.ImageColumn(label="SDXL_Turbo", width="small", help=None),
|
85 |
+
"SDXL_Turbo_Human": st.column_config.NumberColumn("Rating Human", format="%d", width="small", help="Rating Human for SDXL_Turbo"),
|
86 |
+
},
|
87 |
+
hide_index=True, selection_mode="single-row")
|
88 |
+
else:
|
89 |
+
st.write("No data matches the selected filters.")
|
static/DALLE_3/0.jpeg
ADDED
static/DALLE_3/00001.jpeg
ADDED
static/DALLE_3/00002.jpeg
ADDED
static/DALLE_3/00003.jpeg
ADDED
static/DALLE_3/00004.jpeg
ADDED
static/DALLE_3/00005.jpeg
ADDED
static/DALLE_3/00006.jpeg
ADDED
static/DALLE_3/00007.jpeg
ADDED
static/DALLE_3/00008.jpeg
ADDED
static/DALLE_3/00009.jpeg
ADDED
static/DALLE_3/00010.jpeg
ADDED
static/DALLE_3/00011.jpeg
ADDED
static/DALLE_3/00012.jpeg
ADDED
static/DALLE_3/00013.jpeg
ADDED
static/DALLE_3/00014.jpeg
ADDED
static/DALLE_3/00015.jpeg
ADDED
static/DALLE_3/00016.jpeg
ADDED
static/DALLE_3/00017.jpeg
ADDED
static/DALLE_3/00018.jpeg
ADDED
static/DALLE_3/00019.jpeg
ADDED
static/DALLE_3/00020.jpeg
ADDED
static/DALLE_3/00021.jpeg
ADDED
static/DALLE_3/00022.jpeg
ADDED
static/DALLE_3/00023.jpeg
ADDED
static/DALLE_3/00024.jpeg
ADDED
static/DALLE_3/00025.jpeg
ADDED
static/DALLE_3/00026.jpeg
ADDED
static/DALLE_3/00027.jpeg
ADDED
static/DALLE_3/00028.jpeg
ADDED
static/DALLE_3/00029.jpeg
ADDED
static/DALLE_3/00030.jpeg
ADDED
static/DALLE_3/00031.jpeg
ADDED
static/DALLE_3/00032.jpeg
ADDED
static/DALLE_3/00033.jpeg
ADDED
static/DALLE_3/00034.jpeg
ADDED
static/DALLE_3/00035.jpeg
ADDED
static/DALLE_3/00036.jpeg
ADDED
static/DALLE_3/00037.jpeg
ADDED
static/DALLE_3/00038.jpeg
ADDED
static/DALLE_3/00039.jpeg
ADDED
static/DALLE_3/00040.jpeg
ADDED
static/DALLE_3/00041.jpeg
ADDED
static/DALLE_3/00042.jpeg
ADDED
static/DALLE_3/00043.jpeg
ADDED
static/DALLE_3/00044.jpeg
ADDED
static/DALLE_3/00045.jpeg
ADDED
static/DALLE_3/00046.jpeg
ADDED