- Added functionality to preserve target's ears when using Poisson blending.
- Introduced new global variables in `globals.py`:
- `preserve_target_ears` (boolean flag)
- `ear_width_ratio`
- `ear_height_ratio`
- `ear_vertical_offset_ratio`
- `ear_horizontal_overlap_ratio`
- Added command-line argument `--preserve-ears` to `core.py`.
- Modified `face_swapper.py` to adjust the Poisson blending mask by
subtracting calculated ear regions if `preserve_target_ears` is true.
This aims to reduce artifacts around ears by using the original target
frame's ear content.
- Updated `face_swapper.py` to prioritize using the face bounding box (bbox) for creating the Poisson blending mask. This provides a tighter mask around the swapped face area, aiming to reduce artifacts near ears/hairline.
- Implemented fallback to landmark-based convex hull if bbox is invalid or unavailable.
- Added logging for mask generation issues and skipping blending if no valid mask can be created.
- Added histogram-based color correction to `face_swapper.py` for improved color matching of the swapped face to the target frame. Controlled by `--color-correction`.
- Integrated Poisson blending (`cv2.seamlessClone`) for smoother face integration, reducing visible seams. Controlled by `--poisson-blending`.
- Added global variables `use_poisson_blending` and `poisson_blending_feather_amount` and corresponding command-line arguments.
- Refined argument parsing in `core.py` for new features.
- Updated `swap_face` logic to incorporate these features and handle potential errors during blending.
- Add explicit checks for face detection results (source and target faces).
- Handle cases when face embeddings are not available, preventing AttributeError.
- Provide meaningful log messages for easier debugging in future scenarios.