tuan2308 commited on
Commit
decc5b1
1 Parent(s): baffc9e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -3
app.py CHANGED
@@ -6,8 +6,6 @@ import roop.globals
6
  from roop.core import (
7
  start,
8
  decode_execution_providers,
9
- # suggest_max_memory, # Loại bỏ hàm này
10
- # suggest_execution_threads, # Loại bỏ hàm này
11
  )
12
  from roop.processors.frame.core import get_frame_processors_modules
13
  from roop.utilities import normalize_output_path
@@ -35,7 +33,7 @@ def swap_face(source_file, target_file, doFaceEnhancer):
35
  roop.globals.output_path = normalize_output_path(
36
  roop.globals.source_path, roop.globals.target_path, output_path
37
  )
38
- if doFaceEnhancer == True:
39
  roop.globals.frame_processors = ["face_swapper", "face_enhancer"]
40
  else:
41
  roop.globals.frame_processors = ["face_swapper"]
@@ -54,6 +52,10 @@ def swap_face(source_file, target_file, doFaceEnhancer):
54
  if roop.globals.reference_face_position is None:
55
  roop.globals.reference_face_position = 0 # Hoặc một giá trị mặc định khác
56
 
 
 
 
 
57
  print(
58
  "start process",
59
  roop.globals.source_path,
 
6
  from roop.core import (
7
  start,
8
  decode_execution_providers,
 
 
9
  )
10
  from roop.processors.frame.core import get_frame_processors_modules
11
  from roop.utilities import normalize_output_path
 
33
  roop.globals.output_path = normalize_output_path(
34
  roop.globals.source_path, roop.globals.target_path, output_path
35
  )
36
+ if doFaceEnhancer:
37
  roop.globals.frame_processors = ["face_swapper", "face_enhancer"]
38
  else:
39
  roop.globals.frame_processors = ["face_swapper"]
 
52
  if roop.globals.reference_face_position is None:
53
  roop.globals.reference_face_position = 0 # Hoặc một giá trị mặc định khác
54
 
55
+ # Đảm bảo similar_face_distance không phải là None
56
+ if roop.globals.similar_face_distance is None:
57
+ roop.globals.similar_face_distance = 0.6 # Hoặc một giá trị mặc định khác
58
+
59
  print(
60
  "start process",
61
  roop.globals.source_path,