VanNguyen1214 commited on
Commit
250c9f3
·
verified ·
1 Parent(s): 560cc57

Upload face_analyser.py

Browse files
Files changed (1) hide show
  1. roop/face_analyser.py +3 -3
roop/face_analyser.py CHANGED
@@ -23,7 +23,7 @@ def get_face_analyser() -> Any:
23
 
24
  def get_precise_face_mask(frame: Frame) -> Any:
25
  """
26
- Get precise face mask using advanced segmentation (same as detect_face_and_forehead_no_hair).
27
  Returns both InsightFace detection and precise mask.
28
  """
29
  try:
@@ -31,7 +31,7 @@ def get_precise_face_mask(frame: Frame) -> Any:
31
  import sys
32
  import os
33
  sys.path.append(os.path.dirname(os.path.dirname(__file__)))
34
- from segmentation import detect_face_and_forehead_no_hair
35
 
36
  # Convert frame to PIL Image
37
  if isinstance(frame, np.ndarray):
@@ -40,7 +40,7 @@ def get_precise_face_mask(frame: Frame) -> Any:
40
  pil_image = frame
41
 
42
  # Get precise face mask (clean skin only)
43
- precise_mask = detect_face_and_forehead_no_hair(pil_image)
44
 
45
  # Also get InsightFace detection for face swapping compatibility
46
  insightface_faces = get_face_analyser().get(frame)
 
23
 
24
  def get_precise_face_mask(frame: Frame) -> Any:
25
  """
26
+ Get precise face mask using advanced segmentation (same as get_face).
27
  Returns both InsightFace detection and precise mask.
28
  """
29
  try:
 
31
  import sys
32
  import os
33
  sys.path.append(os.path.dirname(os.path.dirname(__file__)))
34
+ from segmentation import get_face
35
 
36
  # Convert frame to PIL Image
37
  if isinstance(frame, np.ndarray):
 
40
  pil_image = frame
41
 
42
  # Get precise face mask (clean skin only)
43
+ precise_mask = get_face(pil_image)
44
 
45
  # Also get InsightFace detection for face swapping compatibility
46
  insightface_faces = get_face_analyser().get(frame)