Spaces:
Running
Running
Add Min Image Size
Browse files
app.py
CHANGED
@@ -32,13 +32,13 @@ source_embeddings = get_embeddings(model, source_faces)
|
|
32 |
|
33 |
def find_names(image, minSize, minConf):
|
34 |
imgs, _ = extract_faces(detector, image)
|
|
|
35 |
for i, face in enumerate(imgs):
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
|
40 |
embeds = get_embeddings(model, imgs)
|
41 |
-
print(len(embeds))
|
42 |
d = np.zeros((len(source_embeddings), len(embeds)))
|
43 |
for i, s in enumerate(source_embeddings):
|
44 |
for j, t in enumerate(embeds):
|
|
|
32 |
|
33 |
def find_names(image, minSize, minConf):
|
34 |
imgs, _ = extract_faces(detector, image)
|
35 |
+
ims = []
|
36 |
for i, face in enumerate(imgs):
|
37 |
+
if((face.size[0] * face.size[1]) > minSize):
|
38 |
+
ims.append(face)
|
39 |
+
imgs = ims
|
40 |
|
41 |
embeds = get_embeddings(model, imgs)
|
|
|
42 |
d = np.zeros((len(source_embeddings), len(embeds)))
|
43 |
for i, s in enumerate(source_embeddings):
|
44 |
for j, t in enumerate(embeds):
|