Spaces:
Running
Running
Commit
·
58e468b
1
Parent(s):
b05b268
Update app.py
Browse files
app.py
CHANGED
@@ -52,6 +52,8 @@ GENERATE_IMAGE_TEXT = "Generate NFT by selecting existing model based on OpenSea
|
|
52 |
INTERPOLATION_TEXT = "Generate interpolation between two NFTs by selecting existing model based on OpenSea collection. You can create new model or imporve existing in few clicks — check [project repository](https://github.com/AlekseyKorshuk/huggingnft)."
|
53 |
COLLECTION2COLLECTION_TEXT = "Generate first NFT with existing model and transform it to another collection by selecting existing model based on OpenSea collections. You can create new model or imporve existing in few clicks — check [project repository](https://github.com/AlekseyKorshuk/huggingnft)."
|
54 |
|
|
|
|
|
55 |
STOPWORDS = ["-old"]
|
56 |
COLLECTION2COLLECTION_KEYS = ["__2__"]
|
57 |
|
@@ -162,13 +164,15 @@ if choose == "Generate image":
|
|
162 |
with st.spinner(text=f"Downloading selected model..."):
|
163 |
model = load_lightweight_model(f"huggingnft/{model_name}")
|
164 |
with st.spinner(text=f"Generating..."):
|
165 |
-
|
166 |
-
model.generate_app(
|
167 |
num=timestamped_filename(),
|
168 |
nrow=nrows,
|
169 |
checkpoint=-1,
|
170 |
types=generation_type
|
171 |
)[0]
|
|
|
|
|
|
|
172 |
)
|
173 |
|
174 |
if choose == "Interpolation":
|
@@ -206,8 +210,10 @@ if choose == "Interpolation":
|
|
206 |
progress_bar=my_bar
|
207 |
)
|
208 |
my_bar.empty()
|
209 |
-
|
210 |
-
|
|
|
|
|
211 |
|
212 |
if choose == "Collection2Collection":
|
213 |
st.title(choose)
|
@@ -280,5 +286,6 @@ if choose == "Collection2Collection":
|
|
280 |
results.append(
|
281 |
get_concat_h(out_transform(make_grid(out_punk, nrow=1, normalize=True)), out_transform(make_grid(out_ape, nrow=1, normalize=True)))
|
282 |
)
|
|
|
283 |
for result in results:
|
284 |
st.image(result)
|
|
|
52 |
INTERPOLATION_TEXT = "Generate interpolation between two NFTs by selecting existing model based on OpenSea collection. You can create new model or imporve existing in few clicks — check [project repository](https://github.com/AlekseyKorshuk/huggingnft)."
|
53 |
COLLECTION2COLLECTION_TEXT = "Generate first NFT with existing model and transform it to another collection by selecting existing model based on OpenSea collections. You can create new model or imporve existing in few clicks — check [project repository](https://github.com/AlekseyKorshuk/huggingnft)."
|
54 |
|
55 |
+
TRAIN_TEXT = "If you think that the results of the model are not good enough and they can be improved, you can train the model more in a few clicks. If you notice that the model is overtrained, then you can easily return to the best version. Check [project repository](https://github.com/AlekseyKorshuk/huggingnft) to know more about that."
|
56 |
+
|
57 |
STOPWORDS = ["-old"]
|
58 |
COLLECTION2COLLECTION_KEYS = ["__2__"]
|
59 |
|
|
|
164 |
with st.spinner(text=f"Downloading selected model..."):
|
165 |
model = load_lightweight_model(f"huggingnft/{model_name}")
|
166 |
with st.spinner(text=f"Generating..."):
|
167 |
+
image = model.generate_app(
|
|
|
168 |
num=timestamped_filename(),
|
169 |
nrow=nrows,
|
170 |
checkpoint=-1,
|
171 |
types=generation_type
|
172 |
)[0]
|
173 |
+
st.markdown(TRAIN_TEXT)
|
174 |
+
st.image(
|
175 |
+
image
|
176 |
)
|
177 |
|
178 |
if choose == "Interpolation":
|
|
|
210 |
progress_bar=my_bar
|
211 |
)
|
212 |
my_bar.empty()
|
213 |
+
st.markdown(TRAIN_TEXT)
|
214 |
+
st.image(
|
215 |
+
result
|
216 |
+
)
|
217 |
|
218 |
if choose == "Collection2Collection":
|
219 |
st.title(choose)
|
|
|
286 |
results.append(
|
287 |
get_concat_h(out_transform(make_grid(out_punk, nrow=1, normalize=True)), out_transform(make_grid(out_ape, nrow=1, normalize=True)))
|
288 |
)
|
289 |
+
st.markdown(TRAIN_TEXT)
|
290 |
for result in results:
|
291 |
st.image(result)
|