20 lines
516 B
Python
20 lines
516 B
Python
import numpy as np
|
|
|
|
from obfuscation.base_obfuscation_technique import ObfuscationTechnique
|
|
|
|
|
|
class Whitening(ObfuscationTechnique):
|
|
"""
|
|
Simply fill the face ROI with a constant colour (white).
|
|
"""
|
|
def __init__(self):
|
|
# Normalise to 3-tuple BGR
|
|
self.colour=(255, 255, 255)
|
|
|
|
def obfuscate(self, face_roi_img_bgr: np.ndarray) -> np.ndarray:
|
|
obf = np.empty_like(face_roi_img_bgr)
|
|
obf[:] = self.colour
|
|
return obf
|
|
|
|
def name(self):
|
|
return "whitening" |