Ricercar commited on
Commit
99a4efe
1 Parent(s): 4d4f66e

change layout to sidebar mode

Browse files
README.md CHANGED
@@ -1,8 +1,8 @@
1
  ---
2
  title: ModelCofferGallery
3
- emoji: 🦀
4
- colorFrom: green
5
- colorTo: pink
6
  sdk: streamlit
7
  sdk_version: 1.21.0
8
  app_file: app.py
 
1
  ---
2
  title: ModelCofferGallery
3
+ emoji: 🖼️
4
+ colorFrom: blue
5
+ colorTo: purple
6
  sdk: streamlit
7
  sdk_version: 1.21.0
8
  app_file: app.py
app.py CHANGED
@@ -15,7 +15,6 @@ class GalleryApp:
15
  self.promptBook = promptBook
16
  st.set_page_config(layout="wide")
17
 
18
-
19
  def gallery(self, items, col_num, info):
20
  cols = st.columns(col_num)
21
  # # sort items by brisque score
@@ -33,7 +32,7 @@ class GalleryApp:
33
  st.title('Model Coffer Gallery')
34
  st.write('This is a gallery of images generated by the models in the Model Coffer')
35
 
36
- metadata, images = st.columns([1, 3])
37
  # with images:
38
  # prompt_tags = self.promptBook['tag'].unique()
39
  # # sort tags by alphabetical order
@@ -43,20 +42,25 @@ class GalleryApp:
43
  # with selecters[0]:
44
  # tag = st.selectbox('Select a tag', prompt_tags)
45
 
46
- with metadata:
 
 
47
  prompt_tags = self.promptBook['tag'].unique()
48
  # sort tags by alphabetical order
49
- prompt_tags = np.sort(prompt_tags)
50
 
51
  tag = st.selectbox('Select a tag', prompt_tags)
52
 
53
  items = self.promptBook[self.promptBook['tag'] == tag].reset_index(drop=True)
54
 
55
- prompts = [', '.join(x.split(', ')[4:]) for x in items['prompt'].unique()]
 
 
 
56
  prompt = st.selectbox('Select prompt', prompts)
57
 
58
  idx = prompts.index(prompt)
59
- prompt_full = ', '.join(items['prompt'].unique()[idx].split(', ')[:4]) + ', ' + prompt
60
 
61
  prompt_id = items[items['prompt'] == prompt_full]['prompt_id'].unique()[0]
62
  items = items[items['prompt_id'] == prompt_id].reset_index(drop=True)
 
15
  self.promptBook = promptBook
16
  st.set_page_config(layout="wide")
17
 
 
18
  def gallery(self, items, col_num, info):
19
  cols = st.columns(col_num)
20
  # # sort items by brisque score
 
32
  st.title('Model Coffer Gallery')
33
  st.write('This is a gallery of images generated by the models in the Model Coffer')
34
 
35
+ # metadata, images = st.columns([1, 3])
36
  # with images:
37
  # prompt_tags = self.promptBook['tag'].unique()
38
  # # sort tags by alphabetical order
 
42
  # with selecters[0]:
43
  # tag = st.selectbox('Select a tag', prompt_tags)
44
 
45
+ images = st.container()
46
+
47
+ with st.sidebar:
48
  prompt_tags = self.promptBook['tag'].unique()
49
  # sort tags by alphabetical order
50
+ prompt_tags = np.sort(prompt_tags)[::-1]
51
 
52
  tag = st.selectbox('Select a tag', prompt_tags)
53
 
54
  items = self.promptBook[self.promptBook['tag'] == tag].reset_index(drop=True)
55
 
56
+ original_prompts = np.sort(items['prompt'].unique())[::-1]
57
+
58
+ # remove the first four items in the prompt, which are mostly the same
59
+ prompts = [', '.join(x.split(', ')[4:]) for x in original_prompts]
60
  prompt = st.selectbox('Select prompt', prompts)
61
 
62
  idx = prompts.index(prompt)
63
+ prompt_full = ', '.join(original_prompts[idx].split(', ')[:4]) + ', ' + prompt
64
 
65
  prompt_id = items[items['prompt'] == prompt_full]['prompt_id'].unique()[0]
66
  items = items[items['prompt_id'] == prompt_id].reset_index(drop=True)
data/download_script.py CHANGED
@@ -21,5 +21,3 @@ def test():
21
 
22
  if __name__ == '__main__':
23
  main()
24
- # load()
25
- # test()
 
21
 
22
  if __name__ == '__main__':
23
  main()
 
 
data/promptbook/data-00009-of-00010.arrow DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:e78fd3a4bf99ef29d2800ceff0962795dccb8e6ff3bcbbfa9433008c5519a6f2
3
- size 477989312
 
 
 
 
data/promptbook/dataset_info.json DELETED
@@ -1,123 +0,0 @@
1
- {
2
- "citation": "",
3
- "dataset_size": 4790396199,
4
- "description": "",
5
- "download_checksums": {
6
- "https://huggingface.co/datasets/NYUSHPRP/ModelCofferPromptBook/resolve/8d6cd80dc1021f48d9603ea14a1f74097ed59a53/data/train-00000-of-00010-cd1633256b85c720.parquet": {
7
- "num_bytes": 483210906,
8
- "checksum": null
9
- },
10
- "https://huggingface.co/datasets/NYUSHPRP/ModelCofferPromptBook/resolve/8d6cd80dc1021f48d9603ea14a1f74097ed59a53/data/train-00001-of-00010-5b5a32ac3990b07d.parquet": {
11
- "num_bytes": 476302101,
12
- "checksum": null
13
- },
14
- "https://huggingface.co/datasets/NYUSHPRP/ModelCofferPromptBook/resolve/8d6cd80dc1021f48d9603ea14a1f74097ed59a53/data/train-00002-of-00010-53e82c1a34dc8a24.parquet": {
15
- "num_bytes": 477247646,
16
- "checksum": null
17
- },
18
- "https://huggingface.co/datasets/NYUSHPRP/ModelCofferPromptBook/resolve/8d6cd80dc1021f48d9603ea14a1f74097ed59a53/data/train-00003-of-00010-1584b725a142a964.parquet": {
19
- "num_bytes": 480767762,
20
- "checksum": null
21
- },
22
- "https://huggingface.co/datasets/NYUSHPRP/ModelCofferPromptBook/resolve/8d6cd80dc1021f48d9603ea14a1f74097ed59a53/data/train-00004-of-00010-71df51519e286b37.parquet": {
23
- "num_bytes": 480021191,
24
- "checksum": null
25
- },
26
- "https://huggingface.co/datasets/NYUSHPRP/ModelCofferPromptBook/resolve/8d6cd80dc1021f48d9603ea14a1f74097ed59a53/data/train-00005-of-00010-496f4d5e272abbcb.parquet": {
27
- "num_bytes": 479774809,
28
- "checksum": null
29
- },
30
- "https://huggingface.co/datasets/NYUSHPRP/ModelCofferPromptBook/resolve/8d6cd80dc1021f48d9603ea14a1f74097ed59a53/data/train-00006-of-00010-fdeaab3f5af10d27.parquet": {
31
- "num_bytes": 476046395,
32
- "checksum": null
33
- },
34
- "https://huggingface.co/datasets/NYUSHPRP/ModelCofferPromptBook/resolve/8d6cd80dc1021f48d9603ea14a1f74097ed59a53/data/train-00007-of-00010-d2388810ca704795.parquet": {
35
- "num_bytes": 477758243,
36
- "checksum": null
37
- },
38
- "https://huggingface.co/datasets/NYUSHPRP/ModelCofferPromptBook/resolve/8d6cd80dc1021f48d9603ea14a1f74097ed59a53/data/train-00008-of-00010-2bc31600a6722b7f.parquet": {
39
- "num_bytes": 479373326,
40
- "checksum": null
41
- },
42
- "https://huggingface.co/datasets/NYUSHPRP/ModelCofferPromptBook/resolve/8d6cd80dc1021f48d9603ea14a1f74097ed59a53/data/train-00009-of-00010-e3f7e9b1da9d35f7.parquet": {
43
- "num_bytes": 477778395,
44
- "checksum": null
45
- }
46
- },
47
- "download_size": 4788280774,
48
- "features": {
49
- "image": {
50
- "_type": "Image"
51
- },
52
- "image_id": {
53
- "dtype": "string",
54
- "_type": "Value"
55
- },
56
- "tag": {
57
- "dtype": "string",
58
- "_type": "Value"
59
- },
60
- "model_id": {
61
- "dtype": "int64",
62
- "_type": "Value"
63
- },
64
- "modelVersion_id": {
65
- "dtype": "int64",
66
- "_type": "Value"
67
- },
68
- "prompt_id": {
69
- "dtype": "int64",
70
- "_type": "Value"
71
- },
72
- "size": {
73
- "dtype": "string",
74
- "_type": "Value"
75
- },
76
- "seed": {
77
- "dtype": "int64",
78
- "_type": "Value"
79
- },
80
- "prompt": {
81
- "dtype": "string",
82
- "_type": "Value"
83
- },
84
- "negativePrompt": {
85
- "dtype": "string",
86
- "_type": "Value"
87
- },
88
- "cfgScale": {
89
- "dtype": "int64",
90
- "_type": "Value"
91
- },
92
- "sampler": {
93
- "dtype": "string",
94
- "_type": "Value"
95
- },
96
- "brisque_score": {
97
- "dtype": "float64",
98
- "_type": "Value"
99
- },
100
- "clip_score": {
101
- "dtype": "float64",
102
- "_type": "Value"
103
- }
104
- },
105
- "homepage": "",
106
- "license": "",
107
- "size_in_bytes": 9578676973,
108
- "splits": {
109
- "train": {
110
- "name": "train",
111
- "num_bytes": 4790396199,
112
- "num_examples": 7935,
113
- "shard_lengths": [
114
- 1588,
115
- 1588,
116
- 1587,
117
- 1586,
118
- 1586
119
- ],
120
- "dataset_name": "parquet"
121
- }
122
- }
123
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
data/promptbook/state.json DELETED
@@ -1,40 +0,0 @@
1
- {
2
- "_data_files": [
3
- {
4
- "filename": "data-00000-of-00010.arrow"
5
- },
6
- {
7
- "filename": "data-00001-of-00010.arrow"
8
- },
9
- {
10
- "filename": "data-00002-of-00010.arrow"
11
- },
12
- {
13
- "filename": "data-00003-of-00010.arrow"
14
- },
15
- {
16
- "filename": "data-00004-of-00010.arrow"
17
- },
18
- {
19
- "filename": "data-00005-of-00010.arrow"
20
- },
21
- {
22
- "filename": "data-00006-of-00010.arrow"
23
- },
24
- {
25
- "filename": "data-00007-of-00010.arrow"
26
- },
27
- {
28
- "filename": "data-00008-of-00010.arrow"
29
- },
30
- {
31
- "filename": "data-00009-of-00010.arrow"
32
- }
33
- ],
34
- "_fingerprint": "1c800ac7347ade50",
35
- "_format_columns": null,
36
- "_format_kwargs": {},
37
- "_format_type": null,
38
- "_output_all_columns": false,
39
- "_split": "train"
40
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
data/roster/data-00000-of-00001.arrow DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:fe153e2d30eb6f28bcbe03bdbf78d99fee777e03917848575f5dc0715f8c3a64
3
- size 109016
 
 
 
 
data/roster/dataset_info.json DELETED
@@ -1,57 +0,0 @@
1
- {
2
- "citation": "",
3
- "dataset_size": 107638,
4
- "description": "",
5
- "download_checksums": {
6
- "https://huggingface.co/datasets/NYUSHPRP/ModelCofferRoster/resolve/ad2d1c28c610862c42861ca20baa814312d06bea/data/train-00000-of-00001-e90719e7788f6218.parquet": {
7
- "num_bytes": 16643,
8
- "checksum": null
9
- }
10
- },
11
- "download_size": 16643,
12
- "features": {
13
- "tag": {
14
- "dtype": "string",
15
- "_type": "Value"
16
- },
17
- "model_name": {
18
- "dtype": "string",
19
- "_type": "Value"
20
- },
21
- "model_id": {
22
- "dtype": "int64",
23
- "_type": "Value"
24
- },
25
- "modelVersion_name": {
26
- "dtype": "string",
27
- "_type": "Value"
28
- },
29
- "modelVersion_id": {
30
- "dtype": "int64",
31
- "_type": "Value"
32
- },
33
- "modelVersion_url": {
34
- "dtype": "string",
35
- "_type": "Value"
36
- },
37
- "modelVersion_trainedWords": {
38
- "dtype": "string",
39
- "_type": "Value"
40
- },
41
- "model_download_count": {
42
- "dtype": "int64",
43
- "_type": "Value"
44
- }
45
- },
46
- "homepage": "",
47
- "license": "",
48
- "size_in_bytes": 124281,
49
- "splits": {
50
- "train": {
51
- "name": "train",
52
- "num_bytes": 107638,
53
- "num_examples": 773,
54
- "dataset_name": "parquet"
55
- }
56
- }
57
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
data/roster/state.json DELETED
@@ -1,13 +0,0 @@
1
- {
2
- "_data_files": [
3
- {
4
- "filename": "data-00000-of-00001.arrow"
5
- }
6
- ],
7
- "_fingerprint": "e1e2eff17d4ef545",
8
- "_format_columns": null,
9
- "_format_kwargs": {},
10
- "_format_type": null,
11
- "_output_all_columns": false,
12
- "_split": "train"
13
- }