This extension offers a powerful and versatile solution for visualizing images, plots, and tensors during Python debugging. It is designed to enhance your debugging workflow with a rich set of features.
A built-in, enhanced image viewer with the following capabilities:
<h4>Image Values</h4>
<img src="https://github.com/elazarcoh/simply-view-image-for-python-debugging/raw/4.1.2/readme-assets/values-example.png" width="300" alt="Image Values"/>
Display pixel values directly on the image.
<h4>Heatmap</h4>
<img src="https://github.com/elazarcoh/simply-view-image-for-python-debugging/raw/4.1.2/readme-assets/heatmap-example.png" width="300" alt="Heatmap"/>
Visualize images as heatmaps with customizable color maps and value clipping.
<h4>Labels</h4>
<img src="https://github.com/elazarcoh/simply-view-image-for-python-debugging/raw/4.1.2/readme-assets/segmentation-example.png" width="300" alt="Segmentation"/>
View label images with color mapping (e.g., 0=black, 1=red, etc.).
<h4>Overlay</h4>
<img src="https://github.com/elazarcoh/simply-view-image-for-python-debugging/raw/4.1.2/readme-assets/overlay-edge-example.png" width="140" alt="Overlay example 1"/>
<img src="https://github.com/elazarcoh/simply-view-image-for-python-debugging/raw/4.1.2/readme-assets/overlay-fill-example.png" width="140" alt="Overlay example 2"/>
Overlay one image on another
Visualize plots from various sources, including:
matplotlib.pyplot.Figurematplotlib.pyplot.AxisInspect tensors from PyTorch and NumPy.
numpy.ndarray is treated as a tensor if it has 4 channels or 3 channels but does not qualify as a single image. Requires scikit-image.Monitor image, plot, or tensor variables and refresh the view at each breakpoint.
I find this feature useful for label images, as they often have small values (0, 1, etc.), which the default viewer does not enhance. - A colorbar for heatmap images with adjustable value clipping. - Interactive Python cell support: Use the Variables tab and click the arrow next to a variable name to view the image.
| Setting | Description | Default Value |
|---|---|---|
svifpd.autoFetchImages |
Controls whether images are automatically fetched.
|
true |
svifpd.restrictImageTypes |
Restricts the types that are considered images.
|
true |
Problem: Memory usage increases significantly when using the extension.
Solution: Enable the restrictImageTypes setting (default: true).
This extension builds upon the foundational work of john-guo. While none of the original code remains, his project served as a valuable inspiration for this extension. Thank you, John!
bash
yarn installbash
yarn build$ claude mcp add simply-view-image-for-python-debugging \
-- python -m otcore.mcp_server <graph>