Deep-Live-Cam/modules
google-labs-jules[bot] ebc30b1cac fix: Address code review feedback from previous PR
This commit implements changes based on the code review feedback
for the recent face swap enhancement features.

Key changes include:

1.  **Error Handling for Color Transfer:**
    *   Wrapped the `apply_color_transfer` call in `swap_face` (within `face_swapper.py`) in a try-except block. If color transfer fails, an error is logged, and the system falls back to using the uncorrected swapped face ROI, preventing pipeline crashes.

2.  **GaussianBlur Kernel Size Validation:**
    *   Added validation logic in `face_swapper.py` for `mouth_mask_blur_kernel_size` and `face_mask_blur_kernel_size`.
    *   A helper function `_validate_kernel_size` ensures that kernel dimensions are positive odd integers. If invalid values are provided via global settings, a warning is logged, and the functions fall back to safe default kernel sizes (e.g., (9,9) for mouth, (5,5) for face).

3.  **Configurable GFPGAN Upscale Factor:**
    *   The `upscale` factor for `GFPGANer` in `face_enhancer.py` is now configurable via `getattr(modules.globals, 'gfpgan_upscale_factor', 2)`, allowing you to adjust this parameter.

4.  **Clarification on Mouth Mask Blur Default:**
    *   Added a comment in `face_swapper.py` explaining that the new default `(9,9)` for `mouth_mask_blur_kernel_size` is a deliberate performance/quality trade-off and that this setting is configurable.

These changes improve the robustness, configurability, and clarity of the recently added features.
2025-06-23 18:02:56 +00:00
..
processors fix: Address code review feedback from previous PR 2025-06-23 18:02:56 +00:00
__init__.py Update __init__.py 2025-05-13 00:14:49 +08:00
capturer.py Revert "recommit webcam option" 2024-09-11 02:49:53 +08:00
cluster_analysis.py Added ability to map faces 2024-09-10 05:40:55 +05:30
core.py add mutil language 2025-01-07 14:04:18 +08:00
face_analyser.py fix: typo souce_target_map → source_target_map 2025-02-03 20:33:44 +09:00
gettext.py add mutil language 2025-01-07 14:04:18 +08:00
globals.py fix: typo souce_target_map → source_target_map 2025-02-03 20:33:44 +09:00
metadata.py Revert "Update metadata.py" 2025-04-17 02:39:05 +08:00
predicter.py add toggle button for blueish cam fix (Force OpenCV2 BGR2RGB) 2024-08-30 22:02:23 +02:00
typing.py initial commit 2023-09-24 21:36:57 +08:00
ui.json reverted to the old version 2024-09-19 17:38:02 +08:00
ui.py fix typos in ui.py 2025-05-07 13:23:31 +02:00
utilities.py Adding Pygrabber as Cam manager 2024-12-13 19:49:11 +05:30
video_capture.py Pygrabber only for Windows 2024-12-16 18:41:39 +05:30