u/deep_vision_pirate

VS Code extension for inspecting image
▲ 6 r/VisualStudio+1 crossposts

VS Code extension for inspecting image

https://reddit.com/link/1uobh4t/video/u2liw3rnrgbh1/player

If you've ever added a temporary cv2.imshow() or plt.imshow() call just to see what's in a variable while debugging, this might save you some time.

What it does

CV Variable Preview hooks into the VS Code debugger so you can inspect Python variables as images without leaving — or modifying — your debug session:

- Right-click any numpy/torch/PIL/TF variable in the Variables or Watch panel → image opens in a side panel instantly
- Hover over a variable name in source → inline thumbnail, shape, dtype, min/max
- Zoom up to 16×, per-pixel value readout, per-channel histogram (32 bins)
- Pin multiple images to compare them side by side — useful for checking augmentation pipelines, comparing activations before and after a layer, etc.
- Live mode: panel refreshes automatically on each F10/F11 step

Supported types

numpy.ndarray, PIL.Image (all modes including palette), torch.Tensor (CPU/CUDA, with or without grad), TensorFlow eager tensors, pandas.DataFrame/Series, lists/batches of arrays (renders as a grid, capped at 64 items).

How it works under the hood

The Python conversion runs entirely inside the active debug frame via a DAP evaluate request — no subprocess, no sidecar process, no imports added to your script. The TS side just reads the result and renders it in a webview.

GitHub: https://github.com/ariharasudhanm/cv-variable-preview

reddit.com
u/deep_vision_pirate — 1 day ago