Spaces:
Running
Running
descriptions update
Browse files- Home.py +9 -2
- pages/Gallery.py +11 -4
- pages/Summary.py +13 -5
Home.py
CHANGED
@@ -42,11 +42,18 @@ if __name__ == '__main__':
|
|
42 |
# print(st.source_util.get_pages('Home.py'))
|
43 |
|
44 |
st.set_page_config(page_title="Login", page_icon="๐ ", layout="wide")
|
45 |
-
st.write('A Research by MAPS Lab, NYU Shanghai')
|
46 |
st.title("๐ Welcome to GEMRec Gallery Webapp!")
|
|
|
|
|
|
|
|
|
47 |
st.write(
|
48 |
"This is an web application to collect personal preference to images synthesised by generative models fine-tuned on stable diffusion. \
|
49 |
-
**You might consider it as a tool for quickly digging out the most suitable model for you from [civitai](https://civitai.com/).**"
|
|
|
|
|
|
|
50 |
)
|
51 |
|
52 |
if 'user_id' not in st.session_state:
|
|
|
42 |
# print(st.source_util.get_pages('Home.py'))
|
43 |
|
44 |
st.set_page_config(page_title="Login", page_icon="๐ ", layout="wide")
|
45 |
+
st.write('A Research by [MAPS Lab](https://whongyi.github.io/MAPS-research), [NYU Shanghai](https://shanghai.nyu.edu)')
|
46 |
st.title("๐ Welcome to GEMRec Gallery Webapp!")
|
47 |
+
st.info("Getting obsessed with tons of different text-to-image generation models available online? \n \
|
48 |
+
Want to find the most suitable one for your taste? \n \
|
49 |
+
**GEMRec** is here to help you!"
|
50 |
+
)
|
51 |
st.write(
|
52 |
"This is an web application to collect personal preference to images synthesised by generative models fine-tuned on stable diffusion. \
|
53 |
+
**You might consider it as a tool for quickly digging out the most suitable text-to-image generation model for you from [civitai](https://civitai.com/).**"
|
54 |
+
)
|
55 |
+
st.write(
|
56 |
+
"After you picking images from gallery page, and ranking them in the ranking page, you will be able to see a dashboard showing your preferred models in the summary page, **with download links of the models ready to use in [Automatic1111 webui](https://github.com/AUTOMATIC1111/stable-diffusion-webui)!**"
|
57 |
)
|
58 |
|
59 |
if 'user_id' not in st.session_state:
|
pages/Gallery.py
CHANGED
@@ -212,15 +212,15 @@ class GalleryApp:
|
|
212 |
with st.sidebar:
|
213 |
prompt_tags = self.promptBook['tag'].unique()
|
214 |
# sort tags by alphabetical order
|
215 |
-
prompt_tags = np.sort(prompt_tags)[
|
216 |
|
217 |
-
tag = st.selectbox('Select a tag', prompt_tags)
|
218 |
|
219 |
items = self.promptBook[self.promptBook['tag'] == tag].reset_index(drop=True)
|
220 |
|
221 |
-
prompts = np.sort(items['prompt'].unique())[
|
222 |
|
223 |
-
selected_prompt = st.selectbox('Select prompt', prompts)
|
224 |
|
225 |
mode = st.radio('Select a mode', ['Gallery', 'Graph'], horizontal=True, index=1)
|
226 |
|
@@ -269,6 +269,13 @@ class GalleryApp:
|
|
269 |
prompt_tags, tag, prompt_id, items, mode = self.sidebar()
|
270 |
# items, info, col_num = self.selection_panel(items)
|
271 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
272 |
# add safety check for some prompts
|
273 |
safety_check = True
|
274 |
unsafe_prompts = {}
|
|
|
212 |
with st.sidebar:
|
213 |
prompt_tags = self.promptBook['tag'].unique()
|
214 |
# sort tags by alphabetical order
|
215 |
+
prompt_tags = np.sort(prompt_tags)[::1]
|
216 |
|
217 |
+
tag = st.selectbox('Select a tag', prompt_tags, index=5)
|
218 |
|
219 |
items = self.promptBook[self.promptBook['tag'] == tag].reset_index(drop=True)
|
220 |
|
221 |
+
prompts = np.sort(items['prompt'].unique())[::1]
|
222 |
|
223 |
+
selected_prompt = st.selectbox('Select prompt', prompts, index=3)
|
224 |
|
225 |
mode = st.radio('Select a mode', ['Gallery', 'Graph'], horizontal=True, index=1)
|
226 |
|
|
|
269 |
prompt_tags, tag, prompt_id, items, mode = self.sidebar()
|
270 |
# items, info, col_num = self.selection_panel(items)
|
271 |
|
272 |
+
# subset = st.radio('Select a subset', ['All', 'Selected Only'], index=0, horizontal=True)
|
273 |
+
# try:
|
274 |
+
# if subset == 'Selected Only':
|
275 |
+
# items = items[items['modelVersion_id'].isin(st.session_state.selected_dict[prompt_id])].reset_index(drop=True)
|
276 |
+
# except:
|
277 |
+
# pass
|
278 |
+
|
279 |
# add safety check for some prompts
|
280 |
safety_check = True
|
281 |
unsafe_prompts = {}
|
pages/Summary.py
CHANGED
@@ -43,6 +43,7 @@ class DashboardApp:
|
|
43 |
|
44 |
tab1, tab2 = st.tabs(['Top Picks', 'Detailed Info'])
|
45 |
|
|
|
46 |
with tab1:
|
47 |
# show the top 3 in metric cards
|
48 |
st.write('## Top picks')
|
@@ -92,11 +93,14 @@ class DashboardApp:
|
|
92 |
image = f"https://modelcofferbucket.s3-accelerate.amazonaws.com/{images[i]}.png"
|
93 |
st.image(image, use_column_width=True)
|
94 |
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
|
|
|
|
|
|
100 |
|
101 |
with tab2:
|
102 |
st.write('## Detailed information of all selected models')
|
@@ -104,6 +108,8 @@ class DashboardApp:
|
|
104 |
st.data_editor(detailed_info, hide_index=True, disabled=True)
|
105 |
|
106 |
|
|
|
|
|
107 |
def score_calculator(self, results, db_table):
|
108 |
# sort results by battle time
|
109 |
results = sorted(results, key=lambda x: x['battletime'])
|
@@ -151,6 +157,8 @@ class DashboardApp:
|
|
151 |
tag = self.sidebar(tags, mode)
|
152 |
self.leaderboard(tag, db_table)
|
153 |
|
|
|
|
|
154 |
|
155 |
if __name__ == "__main__":
|
156 |
st.set_page_config(layout="wide")
|
|
|
43 |
|
44 |
tab1, tab2 = st.tabs(['Top Picks', 'Detailed Info'])
|
45 |
|
46 |
+
|
47 |
with tab1:
|
48 |
# show the top 3 in metric cards
|
49 |
st.write('## Top picks')
|
|
|
93 |
image = f"https://modelcofferbucket.s3-accelerate.amazonaws.com/{images[i]}.png"
|
94 |
st.image(image, use_column_width=True)
|
95 |
|
96 |
+
|
97 |
+
# # st.write('---')
|
98 |
+
# expander = st.expander(f'# {icon} {model_name}, [{modelVersion_name}](https://civitai.com/models/{modelVersion_id})')
|
99 |
+
# with expander:
|
100 |
+
# images = self.promptBook[self.promptBook['modelVersion_id'] == modelVersion_id]['image_id'].values
|
101 |
+
# st.write(images)
|
102 |
+
|
103 |
+
st.chat_input('Please leave your comments here.', key='comment')
|
104 |
|
105 |
with tab2:
|
106 |
st.write('## Detailed information of all selected models')
|
|
|
108 |
st.data_editor(detailed_info, hide_index=True, disabled=True)
|
109 |
|
110 |
|
111 |
+
|
112 |
+
|
113 |
def score_calculator(self, results, db_table):
|
114 |
# sort results by battle time
|
115 |
results = sorted(results, key=lambda x: x['battletime'])
|
|
|
157 |
tag = self.sidebar(tags, mode)
|
158 |
self.leaderboard(tag, db_table)
|
159 |
|
160 |
+
# st.chat_input('Please leave your comments here.', key='comment')
|
161 |
+
|
162 |
|
163 |
if __name__ == "__main__":
|
164 |
st.set_page_config(layout="wide")
|