MCPcopy Index your code
hub / github.com/elazarcoh/simply-view-image-for-python-debugging

github.com/elazarcoh/simply-view-image-for-python-debugging @4.1.2

Chat with this repo
repository ↗ · DeepWiki ↗ · release 4.1.2 ↗ · + Follow
1,372 symbols 3,413 edges 224 files 114 documented · 8%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Icon Simply View Image for Python Debugging

Version Installs Rating

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.

Features

Image Viewer

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

Plot Viewer

Visualize plots from various sources, including:

  • matplotlib.pyplot.Figure
  • matplotlib.pyplot.Axis
  • Plotly Figures (requires saving backend, see here).

Tensor Viewer

Inspect 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.

Watch View

Monitor image, plot, or tensor variables and refresh the view at each breakpoint.

  • Supports custom Python expressions (use with caution to avoid side effects).

Additional Features

  • Hover over variables to view their shape (unrelated to the image viewer, but useful nonetheless).
  • Open local image files (supports PNG, JPG, BMP, TIFF) in the viewer.

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.

Settings

Setting Description Default Value
svifpd.autoFetchImages Controls whether images are automatically fetched.
  • true: Automatically fetch images at each step.
  • false: Fetch images only when the "Fetch Image" button is clicked.
  • "pinned": Automatically fetch pinned images.
true
svifpd.restrictImageTypes Restricts the types that are considered images.
  • true: Only numpy is checked.
  • false: All types are checked.
This setting is useful for improving performance in some cases.
true

Q&A

Memory Issues

Problem: Memory usage increases significantly when using the extension.

Solution: Enable the restrictImageTypes setting (default: true).


Extension Links

Acknowledgment

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!

Development

Prerequisites

  • Node.js: Ensure you have Node.js installed.
  • Yarn: Install Yarn as the package manager.
  • Rust: Required for building the webview.

Build Instructions

  1. Install dependencies: bash yarn install
  2. Build the project: bash yarn build

Extension points exported contracts — how you extend this code

IntoJsArray (Interface)
* Given typed array creates a WebGLBuffer and copies the typed array * into it. * * @param {WebGLRenderingContext} gl [7 …
src/webview-ui/src/webgl_utils/attributes.rs
SessionData (Interface)
(no doc) [2 implementers]
src/session/SessionData.ts
Annotation (Interface)
A single annotated region recorded by DebugAnnotator.
tests/ui-test/image-verification-utils.ts
TypedCommand (Interface)
(no doc)
src/commands.ts
Config (Interface)
(no doc)
src/config.ts
VariableSelection (Interface)
(no doc)
src/types.d.ts
JupyterVariable (Interface)
(no doc)
src/jupyter-intergration.ts
NumpyImageInfo (Interface)
(no doc)
src/viewable/Image.ts

Core symbols most depended-on inside this repo

map
called by 148
src/webview-ui/src/application_state/images.rs
get
called by 136
src/webview-ui/src/common/camera.rs
sleep
called by 56
tests/ui-test/DebugTestHelper.ts
logDebug
called by 50
src/Logging.ts
from
called by 47
tests/unit/ts/__mocks__/vscode.ts
insert
called by 46
src/webview-ui/src/application_state/images.rs
set
called by 41
src/webview-ui/src/common/camera.rs
wait
called by 35
tests/ui-test/DebugTestHelper.ts

Shape

Method 538
Function 479
Class 247
Enum 57
Interface 49
Route 2

Languages

TypeScript45%
Rust38%
Python17%

Modules by API surface

tests/unit/python/test_python_helpers.py83 symbols
tests/ui-test/DebugTestHelper.ts71 symbols
src/webview-ui/src/tmp_for_debug.rs33 symbols
src/webview-ui/src/common/types.rs31 symbols
src/webview-ui/src/vscode/vscode_requests.rs28 symbols
src/webview-ui/src/webgl_utils/types.rs26 symbols
src/webview/communication/WebviewClient.ts25 symbols
src/image-watch-tree/PythonObjectsList.ts25 symbols
src/webview-ui/src/application_state/images.rs24 symbols
tests/ui-test/image-verification-utils.ts23 symbols
src/python/socket_client.py22 symbols
src/python-communication/BuildPythonCode.ts22 symbols

For agents

$ claude mcp add simply-view-image-for-python-debugging \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page