[WIP] Computer vision util: vision visualizer
Author: molbap
Pull request: yes

# What does this PR do?

This PR is a draft to add a new utility tool to display in a notebook (or in ASCII if I crack it) how any processor from any model integrated in `transformers` sees an image. 

Specifically, it is about making readable at a glance how the `image_processor` transforms a given input in  `pixel_values`, and I'll see to add text as well maybe later.

Example usage, for SmolVLM:

```python
 from transformers.utils.processor_visualizer_utils import ImageVisualizer
from PIL import Image

viz = ImageVisualizer('HuggingFaceTB/SmolVLM2-2.2B-Instruct')

image_path = "hf-logo.png"
image = Image.open(image_path).resize((1000, 1349))
viz.visualize(image)
```
should get you the correct tiling + global image

![image](https://github.com/user-attachments/assets/d6bc1b6a-4271-4094-a169-9ce11576d596)



Comments:
🤩👨‍🍳

The docs for this PR live [here](https://moon-ci-docs.huggingface.co/docs/transformers/pr_36892). All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

Before I forget, inspired by an internal DM with Aditya from cornell university, we could add the final processed image resolution in the figure as well. If it is one base image, then a single size and if cropped, then sizes of each patch. Might be very helpful with dynamic patching processors such as Qwen or SmolVLM. WDYT?

Sounds good @zucchini-nlp! 

Writing down a lot these days, reopened and finished this on the way. cc @ArthurZucker and @zucchini-nlp if you want to take a look! Works for ~100 models or so, added the few that don't but took no action upon them now

Supports most image/Text models. Works for:

### 1. High patch counts

<img width="830" height="843" alt="image" src="https://github.com/user-attachments/assets/d7888c74-79c6-43ac-95fe-73937af78ac4" />

### 2. Low patch counts
<img width="933" height="1017" alt="image" src="https://github.com/user-attachments/assets/66c74948-734c-4007-ab2e-603418285eb4" />

### 3. Tiled output with global image (most recent/common)
<img width="470" height="971" alt="image" src="https://github.com/user-attachments/assets/5ef754c9-f9a5-4ba3-8988-bbc8157d55f5" />


### 4. Tiled output without global image (some llava models)

<img width="939" height="713" alt="image" src="https://github.com/user-attachments/assets/4683ced1-34cd-48d9-9274-6da78e37500f" />

Added as well the `default_processor_message` mentioned. I'll move on to the video processor later I think. 
```python
visualizer.default_message(full_output=True)
"""
For a 224x224 RGB png image: 

'
User:<fake_token_around_image><row_1_col_1><image>[...81 tokens...]<image><fake_token_around_image><row_1_col_2><image>[...81 tokens...]<image><fake_token_around_image><row_1_col_3><image>[...81 tokens...]<image><fake_token_around_image><row_1_col_4><image>[...81 tokens...]<image>\n<fake_token_around_image><row_2_col_1><image>[...81 tokens...]<image><fake_token_around_image><row_2_col_2><image>[...81 tokens...]<image><fake_token_around_image><row_2_col_3><image>[...81 tokens...]<image><fake_token_around_image><row_2_col_4><image>[...81 tokens...]<image>\n<fake_token_around_image><row_3_col_1><image>[...81 tokens...]<image><fake_token_around_image><row_3_col_2><image>[...81 tokens...]<image><fake_token_around_image><row_3_col_3><image>[...81 tokens...]<image><fake_token_around_image><row_3_col_4><image>[...81 tokens...]<image>\n<fake_token_around_image><row_4_col_1><image>[...81 tokens...]<image><fake_token_around_image><row_4_col_2><image>[...81 tokens...]<image><fake_token_around_image><row_4_col_3><image>[...81 tokens...]<image><fake_token_around_image><row_4_col_4><image>[...81 tokens...]<image>\n\n<fake_token_around_image><global-img><image>[...81 tokens...]<image><fake_token_around_image>Please describe this image.<end_of_utterance>\nAssistant:'
"""
```

I briefly looked into what would be a terminal/ASCII-friendly version but no luck! 

Hopefully that helps users and adds glance value to processors. 

> Works for ~100 models or so

Super impressive 🚀 

If you want to take up on another visualizer for the community, this is one request I got recently and imo is gonna be very useful as well :)

> For the VLMs, I want to understand the tokeinzation process for the videos and the images. Is there some utility to pre-compute the number of tokens that my message will be broken up into, and how does that relate to the context size of the VLM? I want to use it to compute how I should resize my videos and sub-sample frames so as to provide the maximum visual context to the model

The community comment is exactly the kind of things I want to cover yes! Will open a follow-up PR 

@molbap I think this would make a great demo! would love to help you build or build it myself, however you want :)

Came back to this lol. cc @zucchini-nlp now it should also work for Qwen-type models with ragged tensors! (gives a biiiig grid though)