Spaces:
Sleeping
Sleeping
Update main.py
Browse files
main.py
CHANGED
@@ -6,6 +6,7 @@ import numpy as np
|
|
6 |
import torch
|
7 |
import faiss
|
8 |
import h5py
|
|
|
9 |
import os
|
10 |
import random
|
11 |
from PIL import Image
|
@@ -14,7 +15,7 @@ import matplotlib as mpl
|
|
14 |
|
15 |
img_names = []
|
16 |
with open('list_eval_partition.txt', 'r') as f:
|
17 |
-
for line in f:
|
18 |
img_name, dtype = line.rstrip().split(' ')
|
19 |
img_names.append(img_name)
|
20 |
|
@@ -41,7 +42,7 @@ print('Make index .............')
|
|
41 |
index = faiss.IndexFlatL2(512)
|
42 |
|
43 |
hf = h5py.File('face_vecs_full.h5', 'r')
|
44 |
-
for key in hf.keys():
|
45 |
vec = np.array(hf.get(key))
|
46 |
index.add(vec)
|
47 |
|
|
|
6 |
import torch
|
7 |
import faiss
|
8 |
import h5py
|
9 |
+
import tqdm
|
10 |
import os
|
11 |
import random
|
12 |
from PIL import Image
|
|
|
15 |
|
16 |
img_names = []
|
17 |
with open('list_eval_partition.txt', 'r') as f:
|
18 |
+
for line in tqdm(f):
|
19 |
img_name, dtype = line.rstrip().split(' ')
|
20 |
img_names.append(img_name)
|
21 |
|
|
|
42 |
index = faiss.IndexFlatL2(512)
|
43 |
|
44 |
hf = h5py.File('face_vecs_full.h5', 'r')
|
45 |
+
for key in tqdm(hf.keys()):
|
46 |
vec = np.array(hf.get(key))
|
47 |
index.add(vec)
|
48 |
|