Warlord-K commited on
Commit
80921a1
1 Parent(s): 06d9605

Add Min Image Size

Browse files
Files changed (1) hide show
  1. app.py +4 -4
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
- print(face.size[0], face.size[1])
37
- if(face.size[0] * face.size[1] < minSize):
38
- del imgs[i]
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):