def METHOD_NAME(self, render_dir):
    with torch.no_grad():
        psnr = 0
        for i in tqdm.tqdm(range(len(self.test_dataset))):
            data = self.test_dataset[i]
            rays = data['rays'].cuda()
            pixels = data['pixels'].cuda()
            image_wh = data['image_wh']
            out = self.model.inference(rays)
            psnr += self.criterions(out['comp_rgb'], pixels)
            W, H = image_wh
            img = out['comp_rgb'].view(H, W, 3)
            save_img_dir = os.path.join(render_dir, 'render')
            os.makedirs(save_img_dir, exist_ok=True)
            save_img_path = os.path.join(save_img_dir, f'{i:d}.png')
            self.save_image(save_img_path, img)
        save_video_path = os.path.join(render_dir, 'render.mp4')
        self.save_video(save_video_path, save_img_dir)
        logger.info('test psnr: {}'.format(psnr / len(self.test_dataset)))
        logger.info('save render video done.')
        if self.save_mesh:
            mesh = self.model.isosurface()
            save_mesh_path = os.path.join(render_dir, 'render.obj')
            self.save_obj(save_mesh_path, mesh['v_pos'], mesh['t_pos_idx'])
            logger.info('save render mesh done.')