Refactor variable names in process_frame_v2 for clarity

pull/1340/head
Christoph9211 2025-06-08 16:54:47 -05:00
parent df31fa8083
commit 45f284adb6
1 changed files with 12 additions and 12 deletions

View File

@ -123,32 +123,32 @@ def process_frame_v2(temp_frame: Frame, temp_frame_path: str = "") -> Frame:
if is_image(modules.globals.target_path):
if modules.globals.many_faces:
source_face = default_source_face()
for map_entry in modules.globals.source_target_map: # Renamed 'map' to 'map_entry'
target_face = map_entry['target']['face']
for map in modules.globals.source_target_map:
target_face = map['target']['face']
temp_frame = swap_face(source_face, target_face, temp_frame)
elif not modules.globals.many_faces:
for map_entry in modules.globals.source_target_map: # Renamed 'map' to 'map_entry'
if "source" in map_entry:
source_face = map_entry['source']['face']
target_face = map_entry['target']['face']
for map in modules.globals.source_target_map:
if "source" in map:
source_face = map['source']['face']
target_face = map['target']['face']
temp_frame = swap_face(source_face, target_face, temp_frame)
elif is_video(modules.globals.target_path):
if modules.globals.many_faces:
source_face = default_source_face()
for map_entry in modules.globals.source_target_map: # Renamed 'map' to 'map_entry'
target_frame = [f for f in map_entry['target_faces_in_frame'] if f['location'] == temp_frame_path]
for map in modules.globals.source_target_map:
target_frame = [f for f in map['target_faces_in_frame'] if f['location'] == temp_frame_path]
for frame in target_frame:
for target_face in frame['faces']:
temp_frame = swap_face(source_face, target_face, temp_frame)
elif not modules.globals.many_faces:
for map_entry in modules.globals.source_target_map: # Renamed 'map' to 'map_entry'
if "source" in map_entry:
target_frame = [f for f in map_entry['target_faces_in_frame'] if f['location'] == temp_frame_path]
source_face = map_entry['source']['face']
for map in modules.globals.source_target_map:
if "source" in map:
target_frame = [f for f in map['target_faces_in_frame'] if f['location'] == temp_frame_path]
source_face = map['source']['face']
for frame in target_frame:
for target_face in frame['faces']: