sashavor commited on
Commit
f46cf6c
1 Parent(s): b597545

updating index

Browse files
Files changed (2) hide show
  1. app.py +4 -4
  2. slugs_index_1024_cosine.pickle +2 -2
app.py CHANGED
@@ -9,11 +9,11 @@ with open("slugs_index_1024_cosine.pickle", "rb") as handle:
9
  index = pickle.load(handle)
10
 
11
  # Load model for computing embeddings.
12
- feature_extractor = AutoFeatureExtractor.from_pretrained("sasha/autotrain-butterfly-similarity-2490576840")
13
- model = AutoModel.from_pretrained("sasha/autotrain-butterfly-similarity-2490576840")
14
 
15
  # Candidate images.
16
- dataset = load_dataset("sasha/butterflies_10k_names_multiple")
17
  ds = dataset["train"]
18
 
19
 
@@ -25,7 +25,7 @@ def query(image, top_k=4):
25
  inx = results[0][0].tolist()
26
  logits = results[1][0].tolist()
27
  images = ds.select(inx)["image"]
28
- captions = ds.select(inx)["name"]
29
  images_with_captions = [(i, c) for i, c in zip(images,captions)]
30
  labels_with_probs = dict(zip(captions,logits))
31
  labels_with_probs = {k: 1- v for k, v in labels_with_probs.items()}
 
9
  index = pickle.load(handle)
10
 
11
  # Load model for computing embeddings.
12
+ feature_extractor = AutoFeatureExtractor.from_pretrained("sasha/autotrain-sea-slug-similarity-2498977005")
13
+ model = AutoModel.from_pretrained("sasha/autotrain-sea-slug-similarity-2498977005")
14
 
15
  # Candidate images.
16
+ dataset = load_dataset("sasha/australian_sea_slugs")
17
  ds = dataset["train"]
18
 
19
 
 
25
  inx = results[0][0].tolist()
26
  logits = results[1][0].tolist()
27
  images = ds.select(inx)["image"]
28
+ captions = ds.select(inx)["label"]
29
  images_with_captions = [(i, c) for i, c in zip(images,captions)]
30
  labels_with_probs = dict(zip(captions,logits))
31
  labels_with_probs = {k: 1- v for k, v in labels_with_probs.items()}
slugs_index_1024_cosine.pickle CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:001614717d03b205fa782c2e3f04b7556813d778be55e27426c6590b86a1a5c5
3
- size 20725122
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:bdfd6d5f6f4b429f58395bd9225118f0f13bfc654ba2a8c1fdaef243792ddfcd
3
+ size 20848578