Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -24,6 +24,7 @@ model_name = {
|
|
24 |
"universe": 'huggan/fastgan-few-shot-universe',
|
25 |
"grumpy cat": 'huggan/fastgan-few-shot-grumpy-cat',
|
26 |
"anime": 'huggan/fastgan-few-shot-anime-face',
|
|
|
27 |
}
|
28 |
|
29 |
#@st.cache(allow_output_mutation=True)
|
@@ -63,27 +64,26 @@ def show_model_summary(expanded):
|
|
63 |
with col1:
|
64 |
st.markdown('Fauvism GAN [model](https://huggingface.co/huggan/fastgan-few-shot-fauvism-still-life)', unsafe_allow_html=True)
|
65 |
st.image('fauvism.png', width=200)
|
66 |
-
|
67 |
st.markdown('Painting GAN [model](https://huggingface.co/huggan/fastgan-few-shot-painting)', unsafe_allow_html=True)
|
68 |
st.image('painting.png', width=200)
|
69 |
|
70 |
with col2:
|
71 |
st.markdown('Aurora GAN [model](https://huggingface.co/huggan/fastgan-few-shot-aurora)', unsafe_allow_html=True)
|
72 |
st.image('aurora.png', width=200)
|
73 |
-
|
74 |
st.markdown('Universe GAN [model](https://huggingface.co/huggan/fastgan-few-shot-universe)', unsafe_allow_html=True)
|
75 |
st.image('universe.png', width=200)
|
76 |
|
77 |
with col3:
|
78 |
st.markdown('Anime GAN [model](https://huggingface.co/huggan/fastgan-few-shot-anime-face)', unsafe_allow_html=True)
|
79 |
st.image('anime.png', width=200)
|
80 |
-
|
81 |
st.markdown('Shell GAN [model](https://huggingface.co/huggan/fastgan-few-shot-shells)', unsafe_allow_html=True)
|
82 |
st.image('shell.png', width=200)
|
83 |
|
84 |
with col4:
|
85 |
st.markdown('Grumpy cat GAN [model](https://huggingface.co/huggan/fastgan-few-shot-grumpy-cat)', unsafe_allow_html=True)
|
86 |
st.image('grumpy_cat.png', width=200)
|
|
|
|
|
87 |
|
88 |
|
89 |
def main():
|
@@ -100,9 +100,12 @@ def main():
|
|
100 |
with st.sidebar:
|
101 |
st_lottie(lottie_penguin, height=200)
|
102 |
choose = option_menu(None, ["Model Gallery", "Create your own images"],
|
103 |
-
|
104 |
-
menu_icon="
|
105 |
-
styles={
|
|
|
|
|
|
|
106 |
)
|
107 |
st.sidebar.markdown(
|
108 |
"""
|
@@ -155,10 +158,11 @@ def main():
|
|
155 |
unsafe_allow_html=True,)
|
156 |
|
157 |
if generate_button:
|
158 |
-
with
|
159 |
-
|
160 |
-
|
161 |
-
|
|
|
162 |
with col12:
|
163 |
st.image(gan_images[0], width=300)
|
164 |
if len(gan_images) > 1:
|
|
|
24 |
"universe": 'huggan/fastgan-few-shot-universe',
|
25 |
"grumpy cat": 'huggan/fastgan-few-shot-grumpy-cat',
|
26 |
"anime": 'huggan/fastgan-few-shot-anime-face',
|
27 |
+
"moon gate": 'huggan/fastgan-few-shot-moongate',
|
28 |
}
|
29 |
|
30 |
#@st.cache(allow_output_mutation=True)
|
|
|
64 |
with col1:
|
65 |
st.markdown('Fauvism GAN [model](https://huggingface.co/huggan/fastgan-few-shot-fauvism-still-life)', unsafe_allow_html=True)
|
66 |
st.image('fauvism.png', width=200)
|
|
|
67 |
st.markdown('Painting GAN [model](https://huggingface.co/huggan/fastgan-few-shot-painting)', unsafe_allow_html=True)
|
68 |
st.image('painting.png', width=200)
|
69 |
|
70 |
with col2:
|
71 |
st.markdown('Aurora GAN [model](https://huggingface.co/huggan/fastgan-few-shot-aurora)', unsafe_allow_html=True)
|
72 |
st.image('aurora.png', width=200)
|
|
|
73 |
st.markdown('Universe GAN [model](https://huggingface.co/huggan/fastgan-few-shot-universe)', unsafe_allow_html=True)
|
74 |
st.image('universe.png', width=200)
|
75 |
|
76 |
with col3:
|
77 |
st.markdown('Anime GAN [model](https://huggingface.co/huggan/fastgan-few-shot-anime-face)', unsafe_allow_html=True)
|
78 |
st.image('anime.png', width=200)
|
|
|
79 |
st.markdown('Shell GAN [model](https://huggingface.co/huggan/fastgan-few-shot-shells)', unsafe_allow_html=True)
|
80 |
st.image('shell.png', width=200)
|
81 |
|
82 |
with col4:
|
83 |
st.markdown('Grumpy cat GAN [model](https://huggingface.co/huggan/fastgan-few-shot-grumpy-cat)', unsafe_allow_html=True)
|
84 |
st.image('grumpy_cat.png', width=200)
|
85 |
+
st.markdown('Moon gate GAN [model](https://huggingface.co/huggan/fastgan-few-shot-moongate)', unsafe_allow_html=True)
|
86 |
+
st.image('moon_gate.png', width=200)
|
87 |
|
88 |
|
89 |
def main():
|
|
|
100 |
with st.sidebar:
|
101 |
st_lottie(lottie_penguin, height=200)
|
102 |
choose = option_menu(None, ["Model Gallery", "Create your own images"],
|
103 |
+
icons=['stack', 'file-plus'],
|
104 |
+
menu_icon="cast", default_index=0,
|
105 |
+
styles={
|
106 |
+
"container": {"padding": ".0rem", "font-size": "14px", "background-color": "#11ffee00"},
|
107 |
+
"nav-link-selected": {"color": "#000000", "font-size": "16px"},
|
108 |
+
}
|
109 |
)
|
110 |
st.sidebar.markdown(
|
111 |
"""
|
|
|
158 |
unsafe_allow_html=True,)
|
159 |
|
160 |
if generate_button:
|
161 |
+
with col11:
|
162 |
+
with st.spinner(text=f"Loading selected model..."):
|
163 |
+
generator = load_generator(model_name[img_type])
|
164 |
+
with st.spinner(text=f"Generating images..."):
|
165 |
+
gan_images = generate_images(generator, number_imgs)
|
166 |
with col12:
|
167 |
st.image(gan_images[0], width=300)
|
168 |
if len(gan_images) > 1:
|