def run(self, task_id: int | None = None) -> list[Any]:
        """Run job that visualizes all prediction data.

        Args:
            task_id: Not used in this case.

        Returns:
            list[Any]: Unchanged predictions.
        """
        del task_id  # not needed here

        logger.info("Starting visualization.")

        for batch in tqdm(self.predictions, desc="Visualizing"):
            for item in batch:
                image = visualize_image_item(
                    item,
                    fields=self.fields,
                    overlay_fields=self.overlay_fields,
                    field_size=self.field_size,
                    fields_config=self.fields_config,
                    overlay_fields_config=self.overlay_fields_config,
                    text_config=self.text_config,
                )

                if image is not None:
                    # Get the dataset name and category to save the image
                    filename = generate_output_filename(
                        input_path=item.image_path or "",
                        output_path=self.root_dir,
                        dataset_name=self.dataset_name,
                        category=self.category,
                    )

                    # Save the image to the specified filename
                    image.save(filename)

        return self.predictions
Run job that visualizes all prediction data.

        Args:
            task_id: Not used in this case.

        Returns:
            list[Any]: Unchanged predictions.
        
src/anomalib/pipelines/tiled_ensemble/components/visualization.py