def METHOD_NAME(self, img):
    # bgr2gray
    if self.grayscale:
        img = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
    # resize
    if self.scale is not None:
        img = cv2.resize(
            img,
            (0, 0),
            fx=self.scale,
            fy=self.scale,
            interpolation=cv2.INTER_LINEAR
        )
    return img