def convert(self, img, alpha=1, beta=0):
        """Multiple with alpha and add beat with clip."""
        img = img.astype(np.float32) * alpha + beta
        img = np.clip(img, 0, 255)
        return img.astype(np.uint8)
Multiple with alpha and add beat with clip.
ControlNet-v1-1-nightly/annotator/uniformer/mmseg/datasets/pipelines/transforms.py