mirror of
https://github.com/iperov/DeepFaceLive
synced 2025-07-30 03:30:00 -07:00
upd xlib.image
This commit is contained in:
parent
9f3511d84d
commit
83a090bd63
1 changed files with 5 additions and 1 deletions
|
@ -293,12 +293,16 @@ class ImageProcessor:
|
||||||
self.to_dtype(dtype)
|
self.to_dtype(dtype)
|
||||||
return self
|
return self
|
||||||
|
|
||||||
def median_blur(self, size : int, opacity : float, mask = None) -> 'ImageProcessor':
|
def median_blur(self, size : int, opacity : float = 1.0, mask = None) -> 'ImageProcessor':
|
||||||
"""
|
"""
|
||||||
size int median kernel size
|
size int median kernel size
|
||||||
|
|
||||||
opacity float 0 .. 1.0
|
opacity float 0 .. 1.0
|
||||||
"""
|
"""
|
||||||
|
if size % 2 == 0:
|
||||||
|
size += 1
|
||||||
|
size = max(1, size)
|
||||||
|
|
||||||
opacity = min(1, max(0, opacity))
|
opacity = min(1, max(0, opacity))
|
||||||
if opacity == 0:
|
if opacity == 0:
|
||||||
return self
|
return self
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue