Spaces:
Runtime error
Runtime error
Ceyda Cinarel
commited on
Commit
·
579c59e
1
Parent(s):
3a2f699
change model version
Browse files
app.py
CHANGED
@@ -1,12 +1,7 @@
|
|
1 |
import streamlit as st # HF spaces at v1.2.0
|
2 |
from demo import load_model,generate,get_dataset,embed,make_meme
|
3 |
-
from PIL import Image
|
4 |
-
import numpy as np
|
5 |
-
import io
|
6 |
-
# TODOs
|
7 |
-
# Add markdown short readme project intro
|
8 |
-
# Add link to wandb logs
|
9 |
|
|
|
10 |
|
11 |
st.sidebar.subheader("This butterfly does not exist! ")
|
12 |
st.sidebar.image("assets/logo.png", width=200)
|
@@ -36,8 +31,8 @@ def img2download(image):
|
|
36 |
return imgByteArr
|
37 |
|
38 |
model_name='ceyda/butterfly_cropped_uniq1K_512'
|
39 |
-
|
40 |
-
model_version=None
|
41 |
model=load_model_intocache(model_name,model_version)
|
42 |
dataset=load_dataset()
|
43 |
load_variables()
|
@@ -73,16 +68,6 @@ Based on [paper:](https://openreview.net/forum?id=1Fqg133qRaI) *Towards Faster a
|
|
73 |
i=j%col_num
|
74 |
cols[i].image(im)
|
75 |
picks[j]=cols[i].button("Find Nearest",key="pick_"+str(j))
|
76 |
-
# meme_it=cols[i].button("What is this?",key="meme_"+str(j))
|
77 |
-
# if meme_it:
|
78 |
-
# no_bg=st.checkbox("Remove background?",True)
|
79 |
-
# meme_text=st.text_input("Meme text","Is this a pigeon?")
|
80 |
-
# meme=make_meme(im,text=meme_text,show_text=True,remove_background=no_bg)
|
81 |
-
# st.image(meme)
|
82 |
-
# if picks[j]:
|
83 |
-
# scores, retrieved_examples=dataset.get_nearest_examples('beit_embeddings', embed(im), k=5)
|
84 |
-
# for r in retrieved_examples["image"]:
|
85 |
-
# st.image(r)
|
86 |
|
87 |
if any(picks):
|
88 |
# st.write("Nearest butterflies:")
|
|
|
1 |
import streamlit as st # HF spaces at v1.2.0
|
2 |
from demo import load_model,generate,get_dataset,embed,make_meme
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
|
4 |
+
import io
|
5 |
|
6 |
st.sidebar.subheader("This butterfly does not exist! ")
|
7 |
st.sidebar.image("assets/logo.png", width=200)
|
|
|
31 |
return imgByteArr
|
32 |
|
33 |
model_name='ceyda/butterfly_cropped_uniq1K_512'
|
34 |
+
model_version='57d36a15546909557d9f967f47713236c8288838'
|
35 |
+
# model_version=None
|
36 |
model=load_model_intocache(model_name,model_version)
|
37 |
dataset=load_dataset()
|
38 |
load_variables()
|
|
|
68 |
i=j%col_num
|
69 |
cols[i].image(im)
|
70 |
picks[j]=cols[i].button("Find Nearest",key="pick_"+str(j))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
71 |
|
72 |
if any(picks):
|
73 |
# st.write("Nearest butterflies:")
|