Spaces:
Sleeping
Sleeping
PuristanLabs1
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -11,7 +11,7 @@ device = "cuda" if torch.cuda.is_available() else "cpu"
|
|
11 |
model, preprocess = clip.load("ViT-B/32", device=device)
|
12 |
|
13 |
# Configuration
|
14 |
-
FLAG_IMAGE_DIR = "
|
15 |
|
16 |
# Function to search flags with specific queries using CLIP
|
17 |
def search_by_query(query, top_n=10):
|
@@ -45,7 +45,7 @@ image_paths = [
|
|
45 |
]
|
46 |
|
47 |
# Load precomputed embeddings
|
48 |
-
FLAG_EMBEDDINGS_PATH = "
|
49 |
flag_embeddings = np.load(FLAG_EMBEDDINGS_PATH, allow_pickle=True).item()
|
50 |
|
51 |
def get_country_name(image_filename):
|
|
|
11 |
model, preprocess = clip.load("ViT-B/32", device=device)
|
12 |
|
13 |
# Configuration
|
14 |
+
FLAG_IMAGE_DIR = "./named_flags"
|
15 |
|
16 |
# Function to search flags with specific queries using CLIP
|
17 |
def search_by_query(query, top_n=10):
|
|
|
45 |
]
|
46 |
|
47 |
# Load precomputed embeddings
|
48 |
+
FLAG_EMBEDDINGS_PATH = "./flag_embeddings_1.npy"
|
49 |
flag_embeddings = np.load(FLAG_EMBEDDINGS_PATH, allow_pickle=True).item()
|
50 |
|
51 |
def get_country_name(image_filename):
|