maviced commited on
Commit
7de4fc5
·
verified ·
1 Parent(s): ec80e3a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -3
app.py CHANGED
@@ -21,7 +21,7 @@ with open("lsh.pickle", "rb") as handle:
21
 
22
  # Load model for computing embeddings.
23
  # model_ckpt = "google/vit-base-patch16-224"
24
- model_ckpt = "anggtpd/snacks_classifier"
25
  model = AutoModel.from_pretrained(model_ckpt)
26
  lsh_builder = BuildLSHTable(model)
27
  lsh_builder.lsh = loaded_lsh
@@ -59,7 +59,6 @@ def query(image, top_k):
59
 
60
 
61
  title = "Fetch Similar Snacks 🪴"
62
- description = "This Space demos an image similarity system. You can refer to [this notebook](TODO) to know the details of the system. You can pick any image from the available samples below. On the right hand side, you'll find the similar images returned by the system. The example images have been named with their corresponding integer class labels for easier identification. The fetched images will also have their integer labels tagged so that you can validate the correctness of the results."
63
 
64
  # You can set the type of gr.Image to be PIL, numpy or str (filepath)
65
  # Not sure what the best for this demo is.
@@ -70,6 +69,5 @@ gr.Interface(
70
  outputs=gr.Gallery(),
71
  # Filenames denote the integer labels. Know here: https://hf.co/datasets/beans
72
  title=title,
73
- description=description,
74
  examples=[["0.png", 5], ["1.png", 5], ["2.png", 5]],
75
  ).launch()
 
21
 
22
  # Load model for computing embeddings.
23
  # model_ckpt = "google/vit-base-patch16-224"
24
+ model_ckpt = "matteopilotto/vit-base-patch16-224-in21k-snacks"
25
  model = AutoModel.from_pretrained(model_ckpt)
26
  lsh_builder = BuildLSHTable(model)
27
  lsh_builder.lsh = loaded_lsh
 
59
 
60
 
61
  title = "Fetch Similar Snacks 🪴"
 
62
 
63
  # You can set the type of gr.Image to be PIL, numpy or str (filepath)
64
  # Not sure what the best for this demo is.
 
69
  outputs=gr.Gallery(),
70
  # Filenames denote the integer labels. Know here: https://hf.co/datasets/beans
71
  title=title,
 
72
  examples=[["0.png", 5], ["1.png", 5], ["2.png", 5]],
73
  ).launch()