Spaces:
Running
Running
update with GemRec-18k
Browse files- Archive/test.py +38 -19
- Home.py +9 -3
- data/download_script.py +1 -1
- data/promptbook/{data-00000-of-00022.arrow → data-00000-of-00021.arrow} +2 -2
- data/promptbook/{data-00001-of-00022.arrow → data-00001-of-00021.arrow} +2 -2
- data/promptbook/{data-00002-of-00022.arrow → data-00002-of-00021.arrow} +2 -2
- data/promptbook/{data-00003-of-00022.arrow → data-00003-of-00021.arrow} +2 -2
- data/promptbook/data-00004-of-00021.arrow +3 -0
- data/promptbook/data-00004-of-00022.arrow +0 -3
- data/promptbook/data-00005-of-00021.arrow +3 -0
- data/promptbook/data-00005-of-00022.arrow +0 -3
- data/promptbook/data-00006-of-00021.arrow +3 -0
- data/promptbook/data-00006-of-00022.arrow +0 -3
- data/promptbook/data-00007-of-00021.arrow +3 -0
- data/promptbook/data-00007-of-00022.arrow +0 -3
- data/promptbook/data-00008-of-00021.arrow +3 -0
- data/promptbook/data-00008-of-00022.arrow +0 -3
- data/promptbook/data-00009-of-00021.arrow +3 -0
- data/promptbook/data-00009-of-00022.arrow +0 -3
- data/promptbook/data-00010-of-00021.arrow +3 -0
- data/promptbook/data-00010-of-00022.arrow +0 -3
- data/promptbook/data-00011-of-00021.arrow +3 -0
- data/promptbook/data-00011-of-00022.arrow +0 -3
- data/promptbook/data-00012-of-00021.arrow +3 -0
- data/promptbook/data-00012-of-00022.arrow +0 -3
- data/promptbook/data-00013-of-00021.arrow +3 -0
- data/promptbook/data-00013-of-00022.arrow +0 -3
- data/promptbook/data-00014-of-00021.arrow +3 -0
- data/promptbook/data-00014-of-00022.arrow +0 -3
- data/promptbook/data-00015-of-00021.arrow +3 -0
- data/promptbook/data-00015-of-00022.arrow +0 -3
- data/promptbook/data-00016-of-00021.arrow +3 -0
- data/promptbook/data-00016-of-00022.arrow +0 -3
- data/promptbook/data-00017-of-00021.arrow +3 -0
- data/promptbook/data-00017-of-00022.arrow +0 -3
- data/promptbook/data-00018-of-00021.arrow +3 -0
- data/promptbook/data-00018-of-00022.arrow +0 -3
- data/promptbook/data-00019-of-00021.arrow +3 -0
- data/promptbook/data-00019-of-00022.arrow +0 -3
- data/promptbook/data-00020-of-00021.arrow +3 -0
- data/promptbook/data-00020-of-00022.arrow +0 -3
- data/promptbook/data-00021-of-00022.arrow +0 -3
- data/promptbook/dataset_info.json +68 -72
- data/promptbook/state.json +22 -25
- pages/Gallery.py +26 -28
- pages/Ranking.py +9 -7
Archive/test.py
CHANGED
@@ -1,26 +1,45 @@
|
|
1 |
import streamlit as st
|
|
|
2 |
|
3 |
if __name__ == "__main__":
|
4 |
-
if 'check_dict' not in st.session_state:
|
5 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6 |
|
7 |
-
|
8 |
-
|
9 |
-
st.session_state.check_dict['check2'] = st.checkbox('Check 2 out')
|
10 |
-
st.session_state.check_dict['check3'] = st.checkbox('Check 3 out')
|
11 |
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
|
22 |
-
# Every form must have a submit button.
|
23 |
-
submitted = st.form_submit_button('Submit')
|
24 |
|
25 |
-
for key, value in st.session_state.check_dict.items():
|
26 |
-
st.write(key, value)
|
|
|
1 |
import streamlit as st
|
2 |
+
from streamlit_sortables import sort_items
|
3 |
|
4 |
if __name__ == "__main__":
|
5 |
+
# if 'check_dict' not in st.session_state:
|
6 |
+
# st.session_state.check_dict = {'check1': False, 'check2': False, 'check3': False}
|
7 |
+
#
|
8 |
+
# with st.form('my_form'):
|
9 |
+
# st.session_state.check_dict['check1'] = st.checkbox('Check 1 out')
|
10 |
+
# st.session_state.check_dict['check2'] = st.checkbox('Check 2 out')
|
11 |
+
# st.session_state.check_dict['check3'] = st.checkbox('Check 3 out')
|
12 |
+
#
|
13 |
+
# check21 = st.checkbox('Check 21 out')
|
14 |
+
# if check21:
|
15 |
+
# st.write('check21 is checked')
|
16 |
+
# check22 = st.checkbox('Check 22 out')
|
17 |
+
# if check22:
|
18 |
+
# st.write('check22 is checked')
|
19 |
+
# check23 = st.checkbox('Check 23 out')
|
20 |
+
# if check23:
|
21 |
+
# st.write('check23 is checked')
|
22 |
+
#
|
23 |
+
# # Every form must have a submit button.
|
24 |
+
# submitted = st.form_submit_button('Submit')
|
25 |
+
#
|
26 |
+
# items = ['a', 'b', 'c']
|
27 |
+
# sorted_items = sort_items(items)
|
28 |
+
#
|
29 |
+
# for key, value in st.session_state.check_dict.items():
|
30 |
+
# st.write(key, value)
|
31 |
|
32 |
+
from tqdm import tqdm
|
33 |
+
import time
|
|
|
|
|
34 |
|
35 |
+
outer_list = [1, 2, 3, 4]
|
36 |
+
inner_list = [5, 6, 7, 8]
|
37 |
+
|
38 |
+
# Outer loop
|
39 |
+
for item in tqdm(outer_list, desc="Outer Loop", position=0):
|
40 |
+
# Inner loop with nested=True
|
41 |
+
for inner_item in tqdm(inner_list, desc="Inner Loop", leave=False, position=1):
|
42 |
+
# Your nested loop logic here
|
43 |
+
time.sleep(0.1)
|
44 |
|
|
|
|
|
45 |
|
|
|
|
Home.py
CHANGED
@@ -31,10 +31,16 @@ def save_user_id(user_id):
|
|
31 |
st.session_state.user_id = [user_id, time.time()]
|
32 |
|
33 |
|
|
|
|
|
|
|
|
|
|
|
|
|
34 |
if __name__ == '__main__':
|
35 |
st.set_page_config(page_title="Login", page_icon="🏠", layout="wide")
|
36 |
-
|
37 |
-
st.title("Personalized
|
38 |
st.write(
|
39 |
"This is an web application to collect personal preference to ai generated images. \
|
40 |
You can know which model you like most after you finish the survey."
|
@@ -44,5 +50,5 @@ if __name__ == '__main__':
|
|
44 |
login()
|
45 |
else:
|
46 |
st.write('You have already logged in as ' + st.session_state.user_id[0])
|
47 |
-
st.button('Log out', on_click=
|
48 |
|
|
|
31 |
st.session_state.user_id = [user_id, time.time()]
|
32 |
|
33 |
|
34 |
+
def logout():
|
35 |
+
st.session_state.pop('user_id')
|
36 |
+
st.session_state.pop('selected_dict')
|
37 |
+
st.session_state.pop('score_weights')
|
38 |
+
|
39 |
+
|
40 |
if __name__ == '__main__':
|
41 |
st.set_page_config(page_title="Login", page_icon="🏠", layout="wide")
|
42 |
+
st.write('A Research by MAPS Lab, NYU Shanghai')
|
43 |
+
st.title("Personalized Model Coffer")
|
44 |
st.write(
|
45 |
"This is an web application to collect personal preference to ai generated images. \
|
46 |
You can know which model you like most after you finish the survey."
|
|
|
50 |
login()
|
51 |
else:
|
52 |
st.write('You have already logged in as ' + st.session_state.user_id[0])
|
53 |
+
st.button('Log out', on_click=logout)
|
54 |
|
data/download_script.py
CHANGED
@@ -27,4 +27,4 @@ def test():
|
|
27 |
|
28 |
|
29 |
if __name__ == '__main__':
|
30 |
-
main()
|
|
|
27 |
|
28 |
|
29 |
if __name__ == '__main__':
|
30 |
+
main()
|
data/promptbook/{data-00000-of-00022.arrow → data-00000-of-00021.arrow}
RENAMED
@@ -1,3 +1,3 @@
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:
|
3 |
-
size
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:9d4c93a87aefbe7e08ec5ec804054388d0f3df06f6ce211b4d3761904c611367
|
3 |
+
size 496158744
|
data/promptbook/{data-00001-of-00022.arrow → data-00001-of-00021.arrow}
RENAMED
@@ -1,3 +1,3 @@
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:
|
3 |
-
size
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:bd63d28e10e0b4aa4f9db4120c10f2e4d06bf332cb2df430134cfd121ddfc7a8
|
3 |
+
size 495185576
|
data/promptbook/{data-00002-of-00022.arrow → data-00002-of-00021.arrow}
RENAMED
@@ -1,3 +1,3 @@
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:
|
3 |
-
size
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:66f30060bfce10123613b61a8dfbbffa4115a449cf586fff00b06711fdf24e28
|
3 |
+
size 495550496
|
data/promptbook/{data-00003-of-00022.arrow → data-00003-of-00021.arrow}
RENAMED
@@ -1,3 +1,3 @@
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:
|
3 |
-
size
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:e4de593cb9a90eee455080a3d6b73aa2dfcd9132e4d87fd81a8a12a73ca4a4dc
|
3 |
+
size 495623208
|
data/promptbook/data-00004-of-00021.arrow
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:92bc097038daf76d4c63021273a7881fcf52d8780a8dd16b77d93ebde71d342b
|
3 |
+
size 494484472
|
data/promptbook/data-00004-of-00022.arrow
DELETED
@@ -1,3 +0,0 @@
|
|
1 |
-
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:913f5f2d1a1b4f43af7ee3a445fd95b7be131632c8fe6ebc4e62043f11d8993c
|
3 |
-
size 482131528
|
|
|
|
|
|
|
|
data/promptbook/data-00005-of-00021.arrow
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:a7dafef1072812f1e2b70aaf093a04867acc2f841e82c636d3369d05eaa0e00d
|
3 |
+
size 492936800
|
data/promptbook/data-00005-of-00022.arrow
DELETED
@@ -1,3 +0,0 @@
|
|
1 |
-
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:09dc3cd5f200fcb9b51ce5b1f765e64fbd2a1e874baf94786e1b4be9f6603fb1
|
3 |
-
size 472987752
|
|
|
|
|
|
|
|
data/promptbook/data-00006-of-00021.arrow
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:0d1bcd2f094340906d7211ae58d72d708fbd78c3e3d0c4d83de92f5eff52c6a7
|
3 |
+
size 490180944
|
data/promptbook/data-00006-of-00022.arrow
DELETED
@@ -1,3 +0,0 @@
|
|
1 |
-
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:c7e54194316d71d22cd6a4d85e3b40224398ad59e7eb0a6f100df81ec2b24525
|
3 |
-
size 475610624
|
|
|
|
|
|
|
|
data/promptbook/data-00007-of-00021.arrow
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:4f34a697d66716f91ea238f622892f1e9d468991fcae0947b0c4018d674ef421
|
3 |
+
size 490213760
|
data/promptbook/data-00007-of-00022.arrow
DELETED
@@ -1,3 +0,0 @@
|
|
1 |
-
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:59d63c0724cb6d1a92c927e7b50451298a2da0e3026749f1e0407bfef6428a0b
|
3 |
-
size 479514232
|
|
|
|
|
|
|
|
data/promptbook/data-00008-of-00021.arrow
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:4d313cd4d3c449a5161f245c149117a2b4c2506ab8ae4a03a78c8fbd8f1c0aa0
|
3 |
+
size 492484024
|
data/promptbook/data-00008-of-00022.arrow
DELETED
@@ -1,3 +0,0 @@
|
|
1 |
-
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:ed5fb44739c7a19a3def2a73bc517ce5ee61d8c5264476d8ee15f58707086c65
|
3 |
-
size 480864280
|
|
|
|
|
|
|
|
data/promptbook/data-00009-of-00021.arrow
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:3c07c0537f9bb7d2bb22555880fc91e6574a2b2fb320fba26297424c4629cdba
|
3 |
+
size 494710624
|
data/promptbook/data-00009-of-00022.arrow
DELETED
@@ -1,3 +0,0 @@
|
|
1 |
-
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:185a7a3d7bc290ac3885d60258a87a39b2e1e4b5c9b37c28bdc26a7b9216a63b
|
3 |
-
size 477024712
|
|
|
|
|
|
|
|
data/promptbook/data-00010-of-00021.arrow
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:28a8fdc514f59d42abd692226256b6061256b7cbf6aa43d38c6380c83a469296
|
3 |
+
size 497841824
|
data/promptbook/data-00010-of-00022.arrow
DELETED
@@ -1,3 +0,0 @@
|
|
1 |
-
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:274c1c6ffa42ecc90a429e1c291120e980e4b2f41a94dc6370eeac07fc2b60da
|
3 |
-
size 478651056
|
|
|
|
|
|
|
|
data/promptbook/data-00011-of-00021.arrow
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:2120bc5f6abed224d236a26397611ba6f1ea4f462b7ab6c8e90ecdbddbd0e3d5
|
3 |
+
size 494884984
|
data/promptbook/data-00011-of-00022.arrow
DELETED
@@ -1,3 +0,0 @@
|
|
1 |
-
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:6027ca4f2e1271ac592b9f7e4d8468c12faa35e4c80f1a4389d32a683d5eb945
|
3 |
-
size 476504960
|
|
|
|
|
|
|
|
data/promptbook/data-00012-of-00021.arrow
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:7dd51105646744c753a5cc0d6ef28520d1343f5456c227685dfb38f9aa4bdcfd
|
3 |
+
size 488987880
|
data/promptbook/data-00012-of-00022.arrow
DELETED
@@ -1,3 +0,0 @@
|
|
1 |
-
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:37c314075c4646441e93f8e1da51b2fba28d07f78c874758db049f59a8ea96f8
|
3 |
-
size 474734080
|
|
|
|
|
|
|
|
data/promptbook/data-00013-of-00021.arrow
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:3c9c1e918160b02febc1f8388d469c42bd2c454bebe6e99b681a66afa34a1439
|
3 |
+
size 498320888
|
data/promptbook/data-00013-of-00022.arrow
DELETED
@@ -1,3 +0,0 @@
|
|
1 |
-
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:57ed55fd2e9fbef61ce2ce33cb1a0db2c2b1e95c398008b9a5b3ef6f2c8191fd
|
3 |
-
size 477410888
|
|
|
|
|
|
|
|
data/promptbook/data-00014-of-00021.arrow
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:325ffa8f6d0f7890e452a142b0049f841a3f19b68a94fa29c558d9bc1c241e3b
|
3 |
+
size 489513032
|
data/promptbook/data-00014-of-00022.arrow
DELETED
@@ -1,3 +0,0 @@
|
|
1 |
-
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:0d220f7a0dbec186769fe0d914e2e5833e82f983e7174a5662eb20f521c301d0
|
3 |
-
size 473461464
|
|
|
|
|
|
|
|
data/promptbook/data-00015-of-00021.arrow
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:e80dbbaac0f122c08b4b933aeb4c6b93d86e423f935a9395751aecf78278468b
|
3 |
+
size 495904920
|
data/promptbook/data-00015-of-00022.arrow
DELETED
@@ -1,3 +0,0 @@
|
|
1 |
-
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:4abf3685722d1d81ff9cb1782d16af41d7423326d349329ee60c21d1b38d73b3
|
3 |
-
size 480727944
|
|
|
|
|
|
|
|
data/promptbook/data-00016-of-00021.arrow
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:eb5351757ba8714e2c112eb16b78e906f52ad5c2d91b759672834ef1c3b27b7b
|
3 |
+
size 490964960
|
data/promptbook/data-00016-of-00022.arrow
DELETED
@@ -1,3 +0,0 @@
|
|
1 |
-
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:34aa9bb1d7a4f36e16b51892452df8e50e354593107925e230137b303e768241
|
3 |
-
size 478807688
|
|
|
|
|
|
|
|
data/promptbook/data-00017-of-00021.arrow
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:95d4a7b3089beec67d5192b7a567f12e7723757ae0fc10a97e0f3375751af3ef
|
3 |
+
size 499506568
|
data/promptbook/data-00017-of-00022.arrow
DELETED
@@ -1,3 +0,0 @@
|
|
1 |
-
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:62b0341bdedb2e85c62f695c7a8fa245a887d7f9b7a37ffb2716a5af41073095
|
3 |
-
size 479314720
|
|
|
|
|
|
|
|
data/promptbook/data-00018-of-00021.arrow
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:19e8351bf7b33e42514d45af4b31ee867f5e991537e9c6f32004280be9439206
|
3 |
+
size 493819464
|
data/promptbook/data-00018-of-00022.arrow
DELETED
@@ -1,3 +0,0 @@
|
|
1 |
-
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:6ecf897a49f9f0bd934e2d17fb71929117a8cfe65db4fc5b440cd9a9c7a69494
|
3 |
-
size 485135448
|
|
|
|
|
|
|
|
data/promptbook/data-00019-of-00021.arrow
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:13d51dd80ed80434aa22d5717bfb00d9702538e6224202e31f6d37866f2b110c
|
3 |
+
size 492267312
|
data/promptbook/data-00019-of-00022.arrow
DELETED
@@ -1,3 +0,0 @@
|
|
1 |
-
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:e324a22f2d4b80294c89972873e21f8ae1755963cdeb3dad7186fd566c170af0
|
3 |
-
size 476460440
|
|
|
|
|
|
|
|
data/promptbook/data-00020-of-00021.arrow
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:eb046ae2de02d6ba94ad7d405ceb4910fdcb4e5332678d3ddbfd45cfa27fe3d6
|
3 |
+
size 492600960
|
data/promptbook/data-00020-of-00022.arrow
DELETED
@@ -1,3 +0,0 @@
|
|
1 |
-
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:92089da7f6c5dd153a110841205f350ed3e5e560073f62a793715e9e5e5ec285
|
3 |
-
size 477311424
|
|
|
|
|
|
|
|
data/promptbook/data-00021-of-00022.arrow
DELETED
@@ -1,3 +0,0 @@
|
|
1 |
-
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:c37ce094513f350ee1b3953c3f5a27e7108ec723b95351f1c9b95a8e739b315c
|
3 |
-
size 476791824
|
|
|
|
|
|
|
|
data/promptbook/dataset_info.json
CHANGED
@@ -1,98 +1,94 @@
|
|
1 |
{
|
2 |
"citation": "",
|
3 |
-
"dataset_size":
|
4 |
"description": "",
|
5 |
"download_checksums": {
|
6 |
-
"https://huggingface.co/datasets/NYUSHPRP/ModelCofferPromptBook/resolve/
|
7 |
-
"num_bytes":
|
8 |
"checksum": null
|
9 |
},
|
10 |
-
"https://huggingface.co/datasets/NYUSHPRP/ModelCofferPromptBook/resolve/
|
11 |
-
"num_bytes":
|
12 |
"checksum": null
|
13 |
},
|
14 |
-
"https://huggingface.co/datasets/NYUSHPRP/ModelCofferPromptBook/resolve/
|
15 |
-
"num_bytes":
|
16 |
"checksum": null
|
17 |
},
|
18 |
-
"https://huggingface.co/datasets/NYUSHPRP/ModelCofferPromptBook/resolve/
|
19 |
-
"num_bytes":
|
20 |
"checksum": null
|
21 |
},
|
22 |
-
"https://huggingface.co/datasets/NYUSHPRP/ModelCofferPromptBook/resolve/
|
23 |
-
"num_bytes":
|
24 |
"checksum": null
|
25 |
},
|
26 |
-
"https://huggingface.co/datasets/NYUSHPRP/ModelCofferPromptBook/resolve/
|
27 |
-
"num_bytes":
|
28 |
"checksum": null
|
29 |
},
|
30 |
-
"https://huggingface.co/datasets/NYUSHPRP/ModelCofferPromptBook/resolve/
|
31 |
-
"num_bytes":
|
32 |
"checksum": null
|
33 |
},
|
34 |
-
"https://huggingface.co/datasets/NYUSHPRP/ModelCofferPromptBook/resolve/
|
35 |
-
"num_bytes":
|
36 |
"checksum": null
|
37 |
},
|
38 |
-
"https://huggingface.co/datasets/NYUSHPRP/ModelCofferPromptBook/resolve/
|
39 |
-
"num_bytes":
|
40 |
"checksum": null
|
41 |
},
|
42 |
-
"https://huggingface.co/datasets/NYUSHPRP/ModelCofferPromptBook/resolve/
|
43 |
-
"num_bytes":
|
44 |
"checksum": null
|
45 |
},
|
46 |
-
"https://huggingface.co/datasets/NYUSHPRP/ModelCofferPromptBook/resolve/
|
47 |
-
"num_bytes":
|
48 |
"checksum": null
|
49 |
},
|
50 |
-
"https://huggingface.co/datasets/NYUSHPRP/ModelCofferPromptBook/resolve/
|
51 |
-
"num_bytes":
|
52 |
"checksum": null
|
53 |
},
|
54 |
-
"https://huggingface.co/datasets/NYUSHPRP/ModelCofferPromptBook/resolve/
|
55 |
-
"num_bytes":
|
56 |
"checksum": null
|
57 |
},
|
58 |
-
"https://huggingface.co/datasets/NYUSHPRP/ModelCofferPromptBook/resolve/
|
59 |
-
"num_bytes":
|
60 |
"checksum": null
|
61 |
},
|
62 |
-
"https://huggingface.co/datasets/NYUSHPRP/ModelCofferPromptBook/resolve/
|
63 |
-
"num_bytes":
|
64 |
"checksum": null
|
65 |
},
|
66 |
-
"https://huggingface.co/datasets/NYUSHPRP/ModelCofferPromptBook/resolve/
|
67 |
-
"num_bytes":
|
68 |
"checksum": null
|
69 |
},
|
70 |
-
"https://huggingface.co/datasets/NYUSHPRP/ModelCofferPromptBook/resolve/
|
71 |
-
"num_bytes":
|
72 |
"checksum": null
|
73 |
},
|
74 |
-
"https://huggingface.co/datasets/NYUSHPRP/ModelCofferPromptBook/resolve/
|
75 |
-
"num_bytes":
|
76 |
"checksum": null
|
77 |
},
|
78 |
-
"https://huggingface.co/datasets/NYUSHPRP/ModelCofferPromptBook/resolve/
|
79 |
-
"num_bytes":
|
80 |
"checksum": null
|
81 |
},
|
82 |
-
"https://huggingface.co/datasets/NYUSHPRP/ModelCofferPromptBook/resolve/
|
83 |
-
"num_bytes":
|
84 |
"checksum": null
|
85 |
},
|
86 |
-
"https://huggingface.co/datasets/NYUSHPRP/ModelCofferPromptBook/resolve/
|
87 |
-
"num_bytes":
|
88 |
-
"checksum": null
|
89 |
-
},
|
90 |
-
"https://huggingface.co/datasets/NYUSHPRP/ModelCofferPromptBook/resolve/784dc12ec8b5191524bb8ae145dd2a41658cb5ec/data/train-00021-of-00022-663fb7b32c13cf84.parquet": {
|
91 |
-
"num_bytes": 476572989,
|
92 |
"checksum": null
|
93 |
}
|
94 |
},
|
95 |
-
"download_size":
|
96 |
"features": {
|
97 |
"image": {
|
98 |
"_type": "Image"
|
@@ -134,66 +130,66 @@
|
|
134 |
"_type": "Value"
|
135 |
},
|
136 |
"cfgScale": {
|
137 |
-
"dtype": "
|
138 |
"_type": "Value"
|
139 |
},
|
140 |
"sampler": {
|
141 |
"dtype": "string",
|
142 |
"_type": "Value"
|
143 |
},
|
144 |
-
"
|
145 |
-
"dtype": "
|
146 |
"_type": "Value"
|
147 |
},
|
148 |
-
"
|
149 |
"dtype": "float64",
|
150 |
"_type": "Value"
|
151 |
},
|
152 |
-
"
|
153 |
"dtype": "float64",
|
154 |
"_type": "Value"
|
155 |
},
|
156 |
-
"
|
157 |
"dtype": "float64",
|
158 |
"_type": "Value"
|
159 |
},
|
160 |
-
"
|
161 |
"dtype": "float64",
|
162 |
"_type": "Value"
|
163 |
},
|
164 |
-
"
|
165 |
"dtype": "float64",
|
166 |
"_type": "Value"
|
167 |
},
|
168 |
-
"
|
169 |
"dtype": "float64",
|
170 |
"_type": "Value"
|
171 |
},
|
172 |
-
"
|
173 |
"dtype": "float64",
|
174 |
"_type": "Value"
|
175 |
}
|
176 |
},
|
177 |
"homepage": "",
|
178 |
"license": "",
|
179 |
-
"size_in_bytes":
|
180 |
"splits": {
|
181 |
"train": {
|
182 |
"name": "train",
|
183 |
-
"num_bytes":
|
184 |
-
"num_examples":
|
185 |
"shard_lengths": [
|
186 |
-
|
187 |
-
|
188 |
-
|
189 |
-
|
190 |
-
|
191 |
-
|
192 |
-
|
193 |
-
|
194 |
-
|
195 |
-
|
196 |
-
|
197 |
],
|
198 |
"dataset_name": "parquet"
|
199 |
}
|
|
|
1 |
{
|
2 |
"citation": "",
|
3 |
+
"dataset_size": 10372092350,
|
4 |
"description": "",
|
5 |
"download_checksums": {
|
6 |
+
"https://huggingface.co/datasets/NYUSHPRP/ModelCofferPromptBook/resolve/b1796a1297ac1c43eee27f504c7c2f6e86b3b6d0/data/train-00000-of-00021-cb13a9c5601452a8.parquet": {
|
7 |
+
"num_bytes": 496016415,
|
8 |
"checksum": null
|
9 |
},
|
10 |
+
"https://huggingface.co/datasets/NYUSHPRP/ModelCofferPromptBook/resolve/b1796a1297ac1c43eee27f504c7c2f6e86b3b6d0/data/train-00001-of-00021-67e6474368f65d25.parquet": {
|
11 |
+
"num_bytes": 495045083,
|
12 |
"checksum": null
|
13 |
},
|
14 |
+
"https://huggingface.co/datasets/NYUSHPRP/ModelCofferPromptBook/resolve/b1796a1297ac1c43eee27f504c7c2f6e86b3b6d0/data/train-00002-of-00021-05c79adc841f63cc.parquet": {
|
15 |
+
"num_bytes": 495409904,
|
16 |
"checksum": null
|
17 |
},
|
18 |
+
"https://huggingface.co/datasets/NYUSHPRP/ModelCofferPromptBook/resolve/b1796a1297ac1c43eee27f504c7c2f6e86b3b6d0/data/train-00003-of-00021-e97c0ead8bcad17a.parquet": {
|
19 |
+
"num_bytes": 495478193,
|
20 |
"checksum": null
|
21 |
},
|
22 |
+
"https://huggingface.co/datasets/NYUSHPRP/ModelCofferPromptBook/resolve/b1796a1297ac1c43eee27f504c7c2f6e86b3b6d0/data/train-00004-of-00021-a87f2fad83ef0318.parquet": {
|
23 |
+
"num_bytes": 494335642,
|
24 |
"checksum": null
|
25 |
},
|
26 |
+
"https://huggingface.co/datasets/NYUSHPRP/ModelCofferPromptBook/resolve/b1796a1297ac1c43eee27f504c7c2f6e86b3b6d0/data/train-00005-of-00021-d71f50c4c5f247a6.parquet": {
|
27 |
+
"num_bytes": 492796320,
|
28 |
"checksum": null
|
29 |
},
|
30 |
+
"https://huggingface.co/datasets/NYUSHPRP/ModelCofferPromptBook/resolve/b1796a1297ac1c43eee27f504c7c2f6e86b3b6d0/data/train-00006-of-00021-08ac4e752a2fcaa7.parquet": {
|
31 |
+
"num_bytes": 490037820,
|
32 |
"checksum": null
|
33 |
},
|
34 |
+
"https://huggingface.co/datasets/NYUSHPRP/ModelCofferPromptBook/resolve/b1796a1297ac1c43eee27f504c7c2f6e86b3b6d0/data/train-00007-of-00021-3d30edf024e4ccd4.parquet": {
|
35 |
+
"num_bytes": 490068847,
|
36 |
"checksum": null
|
37 |
},
|
38 |
+
"https://huggingface.co/datasets/NYUSHPRP/ModelCofferPromptBook/resolve/b1796a1297ac1c43eee27f504c7c2f6e86b3b6d0/data/train-00008-of-00021-70cd4539c36b75a3.parquet": {
|
39 |
+
"num_bytes": 492340410,
|
40 |
"checksum": null
|
41 |
},
|
42 |
+
"https://huggingface.co/datasets/NYUSHPRP/ModelCofferPromptBook/resolve/b1796a1297ac1c43eee27f504c7c2f6e86b3b6d0/data/train-00009-of-00021-412b974bb974fb8d.parquet": {
|
43 |
+
"num_bytes": 494567908,
|
44 |
"checksum": null
|
45 |
},
|
46 |
+
"https://huggingface.co/datasets/NYUSHPRP/ModelCofferPromptBook/resolve/b1796a1297ac1c43eee27f504c7c2f6e86b3b6d0/data/train-00010-of-00021-b807277448f7c73f.parquet": {
|
47 |
+
"num_bytes": 497702992,
|
48 |
"checksum": null
|
49 |
},
|
50 |
+
"https://huggingface.co/datasets/NYUSHPRP/ModelCofferPromptBook/resolve/b1796a1297ac1c43eee27f504c7c2f6e86b3b6d0/data/train-00011-of-00021-3a68c6a3b4ae4d64.parquet": {
|
51 |
+
"num_bytes": 494741009,
|
52 |
"checksum": null
|
53 |
},
|
54 |
+
"https://huggingface.co/datasets/NYUSHPRP/ModelCofferPromptBook/resolve/b1796a1297ac1c43eee27f504c7c2f6e86b3b6d0/data/train-00012-of-00021-3f3f86b4f5cb17c3.parquet": {
|
55 |
+
"num_bytes": 488841010,
|
56 |
"checksum": null
|
57 |
},
|
58 |
+
"https://huggingface.co/datasets/NYUSHPRP/ModelCofferPromptBook/resolve/b1796a1297ac1c43eee27f504c7c2f6e86b3b6d0/data/train-00013-of-00021-85cb882e4c2dcb86.parquet": {
|
59 |
+
"num_bytes": 498179776,
|
60 |
"checksum": null
|
61 |
},
|
62 |
+
"https://huggingface.co/datasets/NYUSHPRP/ModelCofferPromptBook/resolve/b1796a1297ac1c43eee27f504c7c2f6e86b3b6d0/data/train-00014-of-00021-2afe87982509f967.parquet": {
|
63 |
+
"num_bytes": 489363721,
|
64 |
"checksum": null
|
65 |
},
|
66 |
+
"https://huggingface.co/datasets/NYUSHPRP/ModelCofferPromptBook/resolve/b1796a1297ac1c43eee27f504c7c2f6e86b3b6d0/data/train-00015-of-00021-eec7637847985493.parquet": {
|
67 |
+
"num_bytes": 495756875,
|
68 |
"checksum": null
|
69 |
},
|
70 |
+
"https://huggingface.co/datasets/NYUSHPRP/ModelCofferPromptBook/resolve/b1796a1297ac1c43eee27f504c7c2f6e86b3b6d0/data/train-00016-of-00021-d6dea60081409784.parquet": {
|
71 |
+
"num_bytes": 490821792,
|
72 |
"checksum": null
|
73 |
},
|
74 |
+
"https://huggingface.co/datasets/NYUSHPRP/ModelCofferPromptBook/resolve/b1796a1297ac1c43eee27f504c7c2f6e86b3b6d0/data/train-00017-of-00021-5add9142d5ead5f9.parquet": {
|
75 |
+
"num_bytes": 499362603,
|
76 |
"checksum": null
|
77 |
},
|
78 |
+
"https://huggingface.co/datasets/NYUSHPRP/ModelCofferPromptBook/resolve/b1796a1297ac1c43eee27f504c7c2f6e86b3b6d0/data/train-00018-of-00021-39b85ca86366c05f.parquet": {
|
79 |
+
"num_bytes": 493676633,
|
80 |
"checksum": null
|
81 |
},
|
82 |
+
"https://huggingface.co/datasets/NYUSHPRP/ModelCofferPromptBook/resolve/b1796a1297ac1c43eee27f504c7c2f6e86b3b6d0/data/train-00019-of-00021-677afc50ca78013a.parquet": {
|
83 |
+
"num_bytes": 492125355,
|
84 |
"checksum": null
|
85 |
},
|
86 |
+
"https://huggingface.co/datasets/NYUSHPRP/ModelCofferPromptBook/resolve/b1796a1297ac1c43eee27f504c7c2f6e86b3b6d0/data/train-00020-of-00021-47bac33a72742d9d.parquet": {
|
87 |
+
"num_bytes": 492454315,
|
|
|
|
|
|
|
|
|
88 |
"checksum": null
|
89 |
}
|
90 |
},
|
91 |
+
"download_size": 10369122623,
|
92 |
"features": {
|
93 |
"image": {
|
94 |
"_type": "Image"
|
|
|
130 |
"_type": "Value"
|
131 |
},
|
132 |
"cfgScale": {
|
133 |
+
"dtype": "int64",
|
134 |
"_type": "Value"
|
135 |
},
|
136 |
"sampler": {
|
137 |
"dtype": "string",
|
138 |
"_type": "Value"
|
139 |
},
|
140 |
+
"note": {
|
141 |
+
"dtype": "string",
|
142 |
"_type": "Value"
|
143 |
},
|
144 |
+
"clip_score": {
|
145 |
"dtype": "float64",
|
146 |
"_type": "Value"
|
147 |
},
|
148 |
+
"msq_score": {
|
149 |
"dtype": "float64",
|
150 |
"_type": "Value"
|
151 |
},
|
152 |
+
"nsfw_score": {
|
153 |
"dtype": "float64",
|
154 |
"_type": "Value"
|
155 |
},
|
156 |
+
"norm_clip": {
|
157 |
"dtype": "float64",
|
158 |
"_type": "Value"
|
159 |
},
|
160 |
+
"norm_nsfw": {
|
161 |
"dtype": "float64",
|
162 |
"_type": "Value"
|
163 |
},
|
164 |
+
"norm_pop": {
|
165 |
"dtype": "float64",
|
166 |
"_type": "Value"
|
167 |
},
|
168 |
+
"norm_msq": {
|
169 |
"dtype": "float64",
|
170 |
"_type": "Value"
|
171 |
}
|
172 |
},
|
173 |
"homepage": "",
|
174 |
"license": "",
|
175 |
+
"size_in_bytes": 20741214973,
|
176 |
"splits": {
|
177 |
"train": {
|
178 |
"name": "train",
|
179 |
+
"num_bytes": 10372092350,
|
180 |
+
"num_examples": 18000,
|
181 |
"shard_lengths": [
|
182 |
+
1716,
|
183 |
+
1715,
|
184 |
+
1714,
|
185 |
+
1714,
|
186 |
+
1714,
|
187 |
+
1714,
|
188 |
+
1714,
|
189 |
+
1714,
|
190 |
+
1714,
|
191 |
+
1714,
|
192 |
+
857
|
193 |
],
|
194 |
"dataset_name": "parquet"
|
195 |
}
|
data/promptbook/state.json
CHANGED
@@ -1,73 +1,70 @@
|
|
1 |
{
|
2 |
"_data_files": [
|
3 |
{
|
4 |
-
"filename": "data-00000-of-
|
5 |
},
|
6 |
{
|
7 |
-
"filename": "data-00001-of-
|
8 |
},
|
9 |
{
|
10 |
-
"filename": "data-00002-of-
|
11 |
},
|
12 |
{
|
13 |
-
"filename": "data-00003-of-
|
14 |
},
|
15 |
{
|
16 |
-
"filename": "data-00004-of-
|
17 |
},
|
18 |
{
|
19 |
-
"filename": "data-00005-of-
|
20 |
},
|
21 |
{
|
22 |
-
"filename": "data-00006-of-
|
23 |
},
|
24 |
{
|
25 |
-
"filename": "data-00007-of-
|
26 |
},
|
27 |
{
|
28 |
-
"filename": "data-00008-of-
|
29 |
},
|
30 |
{
|
31 |
-
"filename": "data-00009-of-
|
32 |
},
|
33 |
{
|
34 |
-
"filename": "data-00010-of-
|
35 |
},
|
36 |
{
|
37 |
-
"filename": "data-00011-of-
|
38 |
},
|
39 |
{
|
40 |
-
"filename": "data-00012-of-
|
41 |
},
|
42 |
{
|
43 |
-
"filename": "data-00013-of-
|
44 |
},
|
45 |
{
|
46 |
-
"filename": "data-00014-of-
|
47 |
},
|
48 |
{
|
49 |
-
"filename": "data-00015-of-
|
50 |
},
|
51 |
{
|
52 |
-
"filename": "data-00016-of-
|
53 |
},
|
54 |
{
|
55 |
-
"filename": "data-00017-of-
|
56 |
},
|
57 |
{
|
58 |
-
"filename": "data-00018-of-
|
59 |
},
|
60 |
{
|
61 |
-
"filename": "data-00019-of-
|
62 |
},
|
63 |
{
|
64 |
-
"filename": "data-00020-of-
|
65 |
-
},
|
66 |
-
{
|
67 |
-
"filename": "data-00021-of-00022.arrow"
|
68 |
}
|
69 |
],
|
70 |
-
"_fingerprint": "
|
71 |
"_format_columns": null,
|
72 |
"_format_kwargs": {},
|
73 |
"_format_type": null,
|
|
|
1 |
{
|
2 |
"_data_files": [
|
3 |
{
|
4 |
+
"filename": "data-00000-of-00021.arrow"
|
5 |
},
|
6 |
{
|
7 |
+
"filename": "data-00001-of-00021.arrow"
|
8 |
},
|
9 |
{
|
10 |
+
"filename": "data-00002-of-00021.arrow"
|
11 |
},
|
12 |
{
|
13 |
+
"filename": "data-00003-of-00021.arrow"
|
14 |
},
|
15 |
{
|
16 |
+
"filename": "data-00004-of-00021.arrow"
|
17 |
},
|
18 |
{
|
19 |
+
"filename": "data-00005-of-00021.arrow"
|
20 |
},
|
21 |
{
|
22 |
+
"filename": "data-00006-of-00021.arrow"
|
23 |
},
|
24 |
{
|
25 |
+
"filename": "data-00007-of-00021.arrow"
|
26 |
},
|
27 |
{
|
28 |
+
"filename": "data-00008-of-00021.arrow"
|
29 |
},
|
30 |
{
|
31 |
+
"filename": "data-00009-of-00021.arrow"
|
32 |
},
|
33 |
{
|
34 |
+
"filename": "data-00010-of-00021.arrow"
|
35 |
},
|
36 |
{
|
37 |
+
"filename": "data-00011-of-00021.arrow"
|
38 |
},
|
39 |
{
|
40 |
+
"filename": "data-00012-of-00021.arrow"
|
41 |
},
|
42 |
{
|
43 |
+
"filename": "data-00013-of-00021.arrow"
|
44 |
},
|
45 |
{
|
46 |
+
"filename": "data-00014-of-00021.arrow"
|
47 |
},
|
48 |
{
|
49 |
+
"filename": "data-00015-of-00021.arrow"
|
50 |
},
|
51 |
{
|
52 |
+
"filename": "data-00016-of-00021.arrow"
|
53 |
},
|
54 |
{
|
55 |
+
"filename": "data-00017-of-00021.arrow"
|
56 |
},
|
57 |
{
|
58 |
+
"filename": "data-00018-of-00021.arrow"
|
59 |
},
|
60 |
{
|
61 |
+
"filename": "data-00019-of-00021.arrow"
|
62 |
},
|
63 |
{
|
64 |
+
"filename": "data-00020-of-00021.arrow"
|
|
|
|
|
|
|
65 |
}
|
66 |
],
|
67 |
+
"_fingerprint": "70624c30882c6104",
|
68 |
"_format_columns": null,
|
69 |
"_format_kwargs": {},
|
70 |
"_format_type": null,
|
pages/Gallery.py
CHANGED
@@ -10,7 +10,7 @@ from bs4 import BeautifulSoup
|
|
10 |
import altair as alt
|
11 |
from streamlit_extras.switch_page_button import switch_page
|
12 |
|
13 |
-
SCORE_NAME_MAPPING = {'clip': 'clip_score', 'rank': '
|
14 |
|
15 |
|
16 |
# hist_data = pd.DataFrame(np.random.normal(42, 10, (200, 1)), columns=["x"])
|
@@ -84,6 +84,9 @@ class GalleryApp:
|
|
84 |
def selection_panel(self, items):
|
85 |
selecters = st.columns([1, 4])
|
86 |
|
|
|
|
|
|
|
87 |
# select sort type
|
88 |
with selecters[0]:
|
89 |
sort_type = st.selectbox('Sort by', ['Scores', 'IDs and Names'])
|
@@ -97,7 +100,7 @@ class GalleryApp:
|
|
97 |
# select sort by
|
98 |
with sub_selecters[0]:
|
99 |
sort_by = st.selectbox('Sort by',
|
100 |
-
['model_name', 'model_id', 'modelVersion_name', 'modelVersion_id'],
|
101 |
label_visibility='hidden')
|
102 |
|
103 |
continue_idx = 1
|
@@ -106,28 +109,30 @@ class GalleryApp:
|
|
106 |
# add custom weights
|
107 |
sub_selecters = st.columns([1, 1, 1, 1])
|
108 |
|
109 |
-
if 'score_weights' not in st.session_state:
|
110 |
-
st.session_state.score_weights = [1.0, 0.8, 0.2, 0.84]
|
111 |
-
|
112 |
with sub_selecters[0]:
|
113 |
clip_weight = st.number_input('Clip Score Weight', min_value=-100.0, max_value=100.0, value=st.session_state.score_weights[0], step=0.1, help='the weight for normalized clip score')
|
114 |
with sub_selecters[1]:
|
115 |
-
|
116 |
with sub_selecters[2]:
|
117 |
pop_weight = st.number_input('Popularity Weight', min_value=-100.0, max_value=100.0, value=st.session_state.score_weights[2], step=0.1, help='the weight for normalized popularity score')
|
118 |
|
119 |
-
items.loc[:, 'weighted_score_sum'] = round(items['norm_clip'] * clip_weight + items['
|
120 |
'norm_pop'] * pop_weight, 4)
|
121 |
|
122 |
continue_idx = 3
|
123 |
|
|
|
|
|
|
|
|
|
|
|
124 |
# select threshold
|
125 |
with sub_selecters[continue_idx]:
|
126 |
-
|
127 |
-
items = items[items['
|
128 |
|
129 |
-
# save latest
|
130 |
-
st.session_state.score_weights =
|
131 |
|
132 |
# draw a distribution histogram
|
133 |
if sort_type == 'Scores':
|
@@ -167,9 +172,9 @@ class GalleryApp:
|
|
167 |
|
168 |
# select info to show
|
169 |
info = st.multiselect('Show Info',
|
170 |
-
['
|
171 |
-
'
|
172 |
-
'
|
173 |
default=sort_by)
|
174 |
|
175 |
# apply sorting to dataframe
|
@@ -190,20 +195,13 @@ class GalleryApp:
|
|
190 |
|
191 |
items = self.promptBook[self.promptBook['tag'] == tag].reset_index(drop=True)
|
192 |
|
193 |
-
|
194 |
|
195 |
-
|
196 |
-
if tag != 'abstract':
|
197 |
-
prompts = [', '.join(x.split(', ')[4:]) for x in original_prompts]
|
198 |
-
prompt = st.selectbox('Select prompt', prompts)
|
199 |
-
|
200 |
-
idx = prompts.index(prompt)
|
201 |
-
prompt_full = ', '.join(original_prompts[idx].split(', ')[:4]) + ', ' + prompt
|
202 |
-
else:
|
203 |
-
prompt_full = st.selectbox('Select prompt', original_prompts)
|
204 |
|
205 |
-
items = items[items['prompt'] ==
|
206 |
prompt_id = items['prompt_id'].unique()[0]
|
|
|
207 |
|
208 |
# show image metadata
|
209 |
image_metadatas = ['prompt_id', 'prompt', 'negativePrompt', 'sampler', 'cfgScale', 'size', 'seed']
|
@@ -215,11 +213,11 @@ class GalleryApp:
|
|
215 |
else:
|
216 |
st.caption(f"{items[key][0]}")
|
217 |
|
218 |
-
# for
|
219 |
-
if
|
220 |
try:
|
221 |
st.write('**Civitai Reference**')
|
222 |
-
res = requests.get(f'https://civitai.com/images/{
|
223 |
# st.write(res.text)
|
224 |
soup = BeautifulSoup(res.text, 'html.parser')
|
225 |
image_section = soup.find('div', {'class': 'mantine-12rlksp'})
|
|
|
10 |
import altair as alt
|
11 |
from streamlit_extras.switch_page_button import switch_page
|
12 |
|
13 |
+
SCORE_NAME_MAPPING = {'clip': 'clip_score', 'rank': 'msq_score', 'pop': 'model_download_count'}
|
14 |
|
15 |
|
16 |
# hist_data = pd.DataFrame(np.random.normal(42, 10, (200, 1)), columns=["x"])
|
|
|
84 |
def selection_panel(self, items):
|
85 |
selecters = st.columns([1, 4])
|
86 |
|
87 |
+
if 'score_weights' not in st.session_state:
|
88 |
+
st.session_state.score_weights = [1.0, 0.8, 0.2, 0.8]
|
89 |
+
|
90 |
# select sort type
|
91 |
with selecters[0]:
|
92 |
sort_type = st.selectbox('Sort by', ['Scores', 'IDs and Names'])
|
|
|
100 |
# select sort by
|
101 |
with sub_selecters[0]:
|
102 |
sort_by = st.selectbox('Sort by',
|
103 |
+
['model_name', 'model_id', 'modelVersion_name', 'modelVersion_id', 'norm_nsfw'],
|
104 |
label_visibility='hidden')
|
105 |
|
106 |
continue_idx = 1
|
|
|
109 |
# add custom weights
|
110 |
sub_selecters = st.columns([1, 1, 1, 1])
|
111 |
|
|
|
|
|
|
|
112 |
with sub_selecters[0]:
|
113 |
clip_weight = st.number_input('Clip Score Weight', min_value=-100.0, max_value=100.0, value=st.session_state.score_weights[0], step=0.1, help='the weight for normalized clip score')
|
114 |
with sub_selecters[1]:
|
115 |
+
msq_weight = st.number_input('mSQ Weight', min_value=-100.0, max_value=100.0, value=st.session_state.score_weights[1], step=0.1, help='the weight for m(eam) s(imilarity) q(antile) score for measuring distinctiveness')
|
116 |
with sub_selecters[2]:
|
117 |
pop_weight = st.number_input('Popularity Weight', min_value=-100.0, max_value=100.0, value=st.session_state.score_weights[2], step=0.1, help='the weight for normalized popularity score')
|
118 |
|
119 |
+
items.loc[:, 'weighted_score_sum'] = round(items['norm_clip'] * clip_weight + items['norm_msq'] * msq_weight + items[
|
120 |
'norm_pop'] * pop_weight, 4)
|
121 |
|
122 |
continue_idx = 3
|
123 |
|
124 |
+
# save latest weights
|
125 |
+
st.session_state.score_weights[0] = clip_weight
|
126 |
+
st.session_state.score_weights[1] = msq_weight
|
127 |
+
st.session_state.score_weights[2] = pop_weight
|
128 |
+
|
129 |
# select threshold
|
130 |
with sub_selecters[continue_idx]:
|
131 |
+
nsfw_threshold = st.number_input('NSFW Score Threshold', min_value=0.0, max_value=1.0, value=st.session_state.score_weights[3], step=0.01, help='Only show models with nsfw score lower than this threshold, set 1.0 to show all images')
|
132 |
+
items = items[items['norm_nsfw'] <= nsfw_threshold].reset_index(drop=True)
|
133 |
|
134 |
+
# save latest threshold
|
135 |
+
st.session_state.score_weights[3] = nsfw_threshold
|
136 |
|
137 |
# draw a distribution histogram
|
138 |
if sort_type == 'Scores':
|
|
|
172 |
|
173 |
# select info to show
|
174 |
info = st.multiselect('Show Info',
|
175 |
+
['model_name', 'model_id', 'modelVersion_name', 'modelVersion_id',
|
176 |
+
'weighted_score_sum', 'model_download_count', 'clip_score', 'msq_score',
|
177 |
+
'nsfw_score', 'norm_nsfw'],
|
178 |
default=sort_by)
|
179 |
|
180 |
# apply sorting to dataframe
|
|
|
195 |
|
196 |
items = self.promptBook[self.promptBook['tag'] == tag].reset_index(drop=True)
|
197 |
|
198 |
+
prompts = np.sort(items['prompt'].unique())[::-1]
|
199 |
|
200 |
+
selected_prompt = st.selectbox('Select prompt', prompts)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
201 |
|
202 |
+
items = items[items['prompt'] == selected_prompt].reset_index(drop=True)
|
203 |
prompt_id = items['prompt_id'].unique()[0]
|
204 |
+
note = items['note'].unique()[0]
|
205 |
|
206 |
# show image metadata
|
207 |
image_metadatas = ['prompt_id', 'prompt', 'negativePrompt', 'sampler', 'cfgScale', 'size', 'seed']
|
|
|
213 |
else:
|
214 |
st.caption(f"{items[key][0]}")
|
215 |
|
216 |
+
# for note as civitai image id, add civitai reference
|
217 |
+
if isinstance(note, str) and note.isdigit():
|
218 |
try:
|
219 |
st.write('**Civitai Reference**')
|
220 |
+
res = requests.get(f'https://civitai.com/images/{note}')
|
221 |
# st.write(res.text)
|
222 |
soup = BeautifulSoup(res.text, 'html.parser')
|
223 |
image_section = soup.find('div', {'class': 'mantine-12rlksp'})
|
pages/Ranking.py
CHANGED
@@ -14,21 +14,23 @@ if __name__ == "__main__":
|
|
14 |
switch_page("home")
|
15 |
|
16 |
else:
|
17 |
-
|
18 |
for key, value in st.session_state.selected_dict.items():
|
19 |
for v in value:
|
20 |
-
|
|
|
21 |
|
22 |
-
if
|
23 |
st.info('You have not checked any image yet. Please go back to the gallery page and check some images.')
|
24 |
gallery_btn = st.button('Go to Gallery')
|
25 |
if gallery_btn:
|
26 |
switch_page('gallery')
|
27 |
else:
|
28 |
-
st.write('You have checked ' + str(
|
29 |
roster, promptBook, images_ds = load_hf_dataset()
|
30 |
st.write("## roster")
|
31 |
-
st.write(roster)
|
32 |
-
st.write(
|
33 |
-
st.write(promptBook)
|
|
|
34 |
|
|
|
14 |
switch_page("home")
|
15 |
|
16 |
else:
|
17 |
+
selected_modelVersions = []
|
18 |
for key, value in st.session_state.selected_dict.items():
|
19 |
for v in value:
|
20 |
+
if v not in selected_modelVersions:
|
21 |
+
selected_modelVersions.append(v)
|
22 |
|
23 |
+
if len(selected_modelVersions) == 0:
|
24 |
st.info('You have not checked any image yet. Please go back to the gallery page and check some images.')
|
25 |
gallery_btn = st.button('Go to Gallery')
|
26 |
if gallery_btn:
|
27 |
switch_page('gallery')
|
28 |
else:
|
29 |
+
st.write('You have checked ' + str(len(selected_modelVersions)) + ' images.')
|
30 |
roster, promptBook, images_ds = load_hf_dataset()
|
31 |
st.write("## roster")
|
32 |
+
st.write(roster[roster['modelVersion_id'].isin(selected_modelVersions)])
|
33 |
+
# st.write(roster)
|
34 |
+
# st.write("## promptBook")
|
35 |
+
# st.write(promptBook)
|
36 |
|