fix: Update type hints for Python 3.9 compatibility
Replaces Python 3.10+ type hint syntax (e.g., Frame | None) with Python 3.9 compatible syntax (e.g., Optional[Frame]) in modules/processors/frame/face_swapper.py. This resolves a TypeError encountered when running on Python 3.9. Specifically, the return type of _prepare_warped_source_material_and_mask was updated.pull/1313/head
							parent
							
								
									3d8af5180d
								
							
						
					
					
						commit
						521cad145d
					
				| 
						 | 
					@ -1,4 +1,4 @@
 | 
				
			||||||
from typing import Any, List
 | 
					from typing import Any, List, Optional, Tuple
 | 
				
			||||||
import cv2
 | 
					import cv2
 | 
				
			||||||
import insightface
 | 
					import insightface
 | 
				
			||||||
import threading
 | 
					import threading
 | 
				
			||||||
| 
						 | 
					@ -72,8 +72,8 @@ def _prepare_warped_source_material_and_mask(
 | 
				
			||||||
    source_face_obj: Face, 
 | 
					    source_face_obj: Face, 
 | 
				
			||||||
    source_frame_full: Frame, 
 | 
					    source_frame_full: Frame, 
 | 
				
			||||||
    matrix: np.ndarray, 
 | 
					    matrix: np.ndarray, 
 | 
				
			||||||
    dsize: tuple
 | 
					    dsize: tuple # Built-in tuple is fine here for parameter type
 | 
				
			||||||
) -> tuple[Frame | None, Frame | None]:
 | 
					) -> Tuple[Optional[Frame], Optional[Frame]]:
 | 
				
			||||||
    """
 | 
					    """
 | 
				
			||||||
    Prepares warped source material (full image) and a combined (face+hair) mask for blending.
 | 
					    Prepares warped source material (full image) and a combined (face+hair) mask for blending.
 | 
				
			||||||
    Returns (None, None) if essential masks cannot be generated.
 | 
					    Returns (None, None) if essential masks cannot be generated.
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue