Deep-Live-Cam/modules/processors
google-labs-jules[bot] 5db23597e9 fix: More robust handling of feathered_mask normalization
This commit provides a more robust fix for the RuntimeWarning
(invalid value encountered in divide/cast) that could occur in
the `apply_mouth_area` function within
`modules/processors/frame/face_swapper.py`.

The previous check for `feathered_mask.max() == 0` was not
sufficient for all floating point edge cases.

The updated logic now:
- Checks if `feathered_mask.max()` is less than a small epsilon (1e-6).
- If true, it logs a warning and explicitly sets `feathered_mask`
  to an all-zero `uint8` array of the correct shape.
- Otherwise, it proceeds with the normalization and casting to `uint8`.

This ensures that division by zero or by extremely small numbers is
prevented, and the `feathered_mask` is always in a valid state for
subsequent blending operations.
2025-06-23 20:45:41 +00:00
..
frame fix: More robust handling of feathered_mask normalization 2025-06-23 20:45:41 +00:00
__init__.py initial commit 2023-09-24 21:36:57 +08:00