def METHOD_NAME(self, trainer):
    """ Images Visulization.
    `visualization_buffer` is a dictionary containing:
        images (list): list of visulaized images.
        filenames (list of str, optional): image filenames.
    """
    visual_results = trainer.visualization_buffer.output
    for vis_key, vis_result in visual_results.items():
        images = vis_result.get('images', [])
        filenames = vis_result.get('filenames', None)
        if filenames is not None:
            assert len(images) == len(
                filenames
            ), 'Output `images` and `filenames` must keep the same length!'
        for i, img in enumerate(images):
            if isinstance(img, np.ndarray):
                img = torch.from_numpy(img)
            else:
                assert isinstance(
                    img, torch.Tensor
                ), f'Only support np.ndarray and torch.Tensor type! Got {type(img)} for img {filenames[i]}'
            default_name = 'image_%i' % i
            filename = filenames[
                i] if filenames is not None else default_name
            self.writer.add_image(
                f'{vis_key}/{filename}',
                img,
                self.get_iter(trainer),
                dataformats='HWC')