ParisNeo commited on
Commit
5a68348
·
1 Parent(s): 7ab4581
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -263,7 +263,6 @@ class UI():
263
  embedding = DeepFace.represent(image, enforce_detection=False)[0]["embedding"]
264
  self.embeddings_cloud.append(embedding)
265
  self.i+=1
266
- cv2.imshow('Face Mesh', cv2.cvtColor(image, cv2.COLOR_BGR2RGB))
267
  except Exception as ex:
268
  print(ex)
269
  return f"Processing frame {self.i}/{self.nb_images}..."
@@ -296,6 +295,7 @@ class UI():
296
 
297
  if images is not None:
298
  for entry in images:
 
299
  image = cv2.cvtColor(cv2.imread(entry["name"]), cv2.COLOR_BGR2RGB)
300
  if image is None:
301
  return None
@@ -306,6 +306,7 @@ class UI():
306
  # Process the image to extract faces and draw the masks on the face in the image
307
  fa.process(image)
308
  if fa.nb_faces>0:
 
309
  try:
310
  face = fa.faces[0]
311
  vertices = face.get_face_outer_vertices()
@@ -313,7 +314,6 @@ class UI():
313
  embedding = DeepFace.represent(image, enforce_detection=False)[0]["embedding"]
314
  self.embeddings_cloud.append(embedding)
315
  self.i+=1
316
- cv2.imshow('Face Mesh', cv2.cvtColor(image, cv2.COLOR_BGR2RGB))
317
  except Exception as ex:
318
  print(ex)
319
  # Now let's find out where the face lives inside the latent space (128 dimensions space)
 
263
  embedding = DeepFace.represent(image, enforce_detection=False)[0]["embedding"]
264
  self.embeddings_cloud.append(embedding)
265
  self.i+=1
 
266
  except Exception as ex:
267
  print(ex)
268
  return f"Processing frame {self.i}/{self.nb_images}..."
 
295
 
296
  if images is not None:
297
  for entry in images:
298
+ print(f"Processing image {entry['name']}")
299
  image = cv2.cvtColor(cv2.imread(entry["name"]), cv2.COLOR_BGR2RGB)
300
  if image is None:
301
  return None
 
306
  # Process the image to extract faces and draw the masks on the face in the image
307
  fa.process(image)
308
  if fa.nb_faces>0:
309
+ print(f"Found {fa.nb_faces} faces")
310
  try:
311
  face = fa.faces[0]
312
  vertices = face.get_face_outer_vertices()
 
314
  embedding = DeepFace.represent(image, enforce_detection=False)[0]["embedding"]
315
  self.embeddings_cloud.append(embedding)
316
  self.i+=1
 
317
  except Exception as ex:
318
  print(ex)
319
  # Now let's find out where the face lives inside the latent space (128 dimensions space)