g8a9 commited on
Commit
71b659e
1 Parent(s): 6668c84

Add new CC embeddings

Browse files
.gitattributes CHANGED
@@ -15,3 +15,4 @@
15
  *.pt filter=lfs diff=lfs merge=lfs -text
16
  *.pth filter=lfs diff=lfs merge=lfs -text
17
  *.npy filter=lfs diff=lfs merge=lfs -text
 
 
15
  *.pt filter=lfs diff=lfs merge=lfs -text
16
  *.pth filter=lfs diff=lfs merge=lfs -text
17
  *.npy filter=lfs diff=lfs merge=lfs -text
18
+ static/CC_urls.txt filter=lfs diff=lfs merge=lfs -text
static/CC_val_urls.txt DELETED
The diff for this file is too large to render. See raw diff
 
static/features/{CC_val_embeddings.npy → CC_embeddings.npy} RENAMED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:775803a42011b09e8f5d19fcbdd67123cc3447154e1f8e5990cae1bce4581662
3
- size 27369600
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b1b3673a79725593e629f225f337cb5bbcea0285ecfffabf0109114adcf394e9
3
+ size 301871232
text2image.py CHANGED
@@ -69,13 +69,13 @@ def get_image_features(dataset_name):
69
  if dataset_name == "Unsplash":
70
  return jnp.load("static/features/features.npy")
71
  else:
72
- return jnp.load("static/features/CC_val_embeddings.npy")
73
 
74
 
75
  @st.cache()
76
  def load_urls(dataset_name):
77
  if dataset_name == "CC":
78
- with open("static/CC_val_urls.txt") as fp:
79
  urls = [l.strip() for l in fp.readlines()]
80
  return urls
81
  else:
 
69
  if dataset_name == "Unsplash":
70
  return jnp.load("static/features/features.npy")
71
  else:
72
+ return jnp.load("static/features/CC_embeddings.npy")
73
 
74
 
75
  @st.cache()
76
  def load_urls(dataset_name):
77
  if dataset_name == "CC":
78
+ with open("static/CC_urls.txt") as fp:
79
  urls = [l.strip() for l in fp.readlines()]
80
  return urls
81
  else: