def apply_image(self, image: np.ndarray) -> np.ndarray:
        """
        Expects a numpy array with shape HxWxC in uint8 format.
        """
        target_size = self.get_preprocess_shape(image.shape[0], image.shape[1],
                                                self.target_length)
        return np.array(resize(to_pil_image(image), target_size))

        Expects a numpy array with shape HxWxC in uint8 format.
        
contrib/SegmentAnything/segment_anything/utils/transforms.py