Compare commits
	
		
			No commits in common. "80477676b4d4edec572edd17ffdff3e15b2260b6" and "390b88216bd5f256276d52f08c21c6e0c7d48e37" have entirely different histories. 
		
	
	
		
			80477676b4
			...
			390b88216b
		
	
		
	| 
						 | 
					@ -4,7 +4,6 @@ import insightface
 | 
				
			||||||
import threading
 | 
					import threading
 | 
				
			||||||
import numpy as np
 | 
					import numpy as np
 | 
				
			||||||
import modules.globals
 | 
					import modules.globals
 | 
				
			||||||
import logging
 | 
					 | 
				
			||||||
import modules.processors.frame.core
 | 
					import modules.processors.frame.core
 | 
				
			||||||
from modules.core import update_status
 | 
					from modules.core import update_status
 | 
				
			||||||
from modules.face_analyser import get_one_face, get_many_faces, default_source_face
 | 
					from modules.face_analyser import get_one_face, get_many_faces, default_source_face
 | 
				
			||||||
| 
						 | 
					@ -106,20 +105,14 @@ def process_frame(source_face: Face, temp_frame: Frame) -> Frame:
 | 
				
			||||||
        many_faces = get_many_faces(temp_frame)
 | 
					        many_faces = get_many_faces(temp_frame)
 | 
				
			||||||
        if many_faces:
 | 
					        if many_faces:
 | 
				
			||||||
            for target_face in many_faces:
 | 
					            for target_face in many_faces:
 | 
				
			||||||
                if source_face and target_face:
 | 
					 | 
				
			||||||
                temp_frame = swap_face(source_face, target_face, temp_frame)
 | 
					                temp_frame = swap_face(source_face, target_face, temp_frame)
 | 
				
			||||||
                else:
 | 
					 | 
				
			||||||
                    print("Face detection failed for target/source.")
 | 
					 | 
				
			||||||
    else:
 | 
					    else:
 | 
				
			||||||
        target_face = get_one_face(temp_frame)
 | 
					        target_face = get_one_face(temp_frame)
 | 
				
			||||||
        if target_face and source_face:
 | 
					        if target_face:
 | 
				
			||||||
            temp_frame = swap_face(source_face, target_face, temp_frame)
 | 
					            temp_frame = swap_face(source_face, target_face, temp_frame)
 | 
				
			||||||
        else:
 | 
					 | 
				
			||||||
            logging.error("Face detection failed for target or source.")
 | 
					 | 
				
			||||||
    return temp_frame
 | 
					    return temp_frame
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					 | 
				
			||||||
def process_frame_v2(temp_frame: Frame, temp_frame_path: str = "") -> Frame:
 | 
					def process_frame_v2(temp_frame: Frame, temp_frame_path: str = "") -> Frame:
 | 
				
			||||||
    if is_image(modules.globals.target_path):
 | 
					    if is_image(modules.globals.target_path):
 | 
				
			||||||
        if modules.globals.many_faces:
 | 
					        if modules.globals.many_faces:
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue