Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -75,6 +75,15 @@ conceptual_weight = hf_hub_download(repo_id="akhaliq/CLIP-prefix-captioning-conc
|
|
| 75 |
coco_weight = hf_hub_download(repo_id="akhaliq/CLIP-prefix-captioning-COCO-weights", filename="coco_weights.pt")
|
| 76 |
|
| 77 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 78 |
height = 256 # height for resizing images
|
| 79 |
|
| 80 |
def predict(image, labels):
|
|
@@ -193,14 +202,7 @@ def get_caption(img,model_name):
|
|
| 193 |
# return get_images(text, api_name="images")
|
| 194 |
|
| 195 |
|
| 196 |
-
emb_filename = hf_hub_download(
|
| 197 |
-
repo_id="ryaalbr/QuestApp",
|
| 198 |
-
filename="unsplash-25k-photos-embeddings-indexes.pkl",
|
| 199 |
-
repo_type="space"
|
| 200 |
-
)
|
| 201 |
|
| 202 |
-
with open(emb_filename, 'rb') as emb:
|
| 203 |
-
id2url, img_names, img_emb = pickle.load(emb)
|
| 204 |
|
| 205 |
|
| 206 |
def search(search_query):
|
|
|
|
| 75 |
coco_weight = hf_hub_download(repo_id="akhaliq/CLIP-prefix-captioning-COCO-weights", filename="coco_weights.pt")
|
| 76 |
|
| 77 |
|
| 78 |
+
emb_filename = hf_hub_download(
|
| 79 |
+
repo_id="ryaalbr/QuestApp",
|
| 80 |
+
filename="unsplash-25k-photos-embeddings-indexes.pkl",
|
| 81 |
+
repo_type="space"
|
| 82 |
+
)
|
| 83 |
+
with open(emb_filename, 'rb') as emb:
|
| 84 |
+
id2url, img_names, img_emb = pickle.load(emb)
|
| 85 |
+
|
| 86 |
+
|
| 87 |
height = 256 # height for resizing images
|
| 88 |
|
| 89 |
def predict(image, labels):
|
|
|
|
| 202 |
# return get_images(text, api_name="images")
|
| 203 |
|
| 204 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 205 |
|
|
|
|
|
|
|
| 206 |
|
| 207 |
|
| 208 |
def search(search_query):
|