def METHOD_NAME(self, input: Union[Dict[str, Any],
                                  tuple]) -> Dict[str, Any]:
    if isinstance(input, tuple):
        index_model = 0
        index_pose = 1
        index_cloth = 2
    else:
        index_model = 'masked_model'
        index_pose = 'pose'
        index_cloth = 'cloth'
    if isinstance(input[index_model], str):
        img_agnostic = load_image(input[index_model])
        pose = load_image(input[index_pose])
        cloth_img = load_image(input[index_cloth])
    elif isinstance(input[index_model], PIL.Image.Image):
        img_agnostic = input[index_model].convert('RGB')
        pose = input[index_pose].convert('RGB')
        cloth_img = input[index_cloth].convert('RGB')
    elif isinstance(input[index_model], np.ndarray):
        if len(input.shape) == 2:
            img_agnostic = cv2.cvtColor(input[index_model],
                                        cv2.COLOR_GRAY2BGR)
            pose = cv2.cvtColor(input[index_pose], cv2.COLOR_GRAY2BGR)
            cloth_img = cv2.cvtColor(input[index_cloth],
                                     cv2.COLOR_GRAY2BGR)
        img_agnostic = Image.fromarray(
            img_agnostic[:, :, ::-1].astype('uint8')).convert('RGB')
        pose = Image.fromarray(
            pose[:, :, ::-1].astype('uint8')).convert('RGB')
        cloth_img = Image.fromarray(
            cloth_img[:, :, ::-1].astype('uint8')).convert('RGB')
    else:
        raise TypeError(f'input should be either str, PIL.Image,'
                        f' np.array, but got {type(input)}')
    img_agnostic = self.test_transforms(img_agnostic)
    pose = self.test_transforms(pose)
    cloth_img = self.test_transforms(cloth_img)
    inputs = {
        'masked_model': img_agnostic.unsqueeze(0),
        'pose': pose.unsqueeze(0),
        'cloth': cloth_img.unsqueeze(0)
    }
    return inputs