Skip to main content

Layer-by-layer visualizer for PyTorch models

Project description

torch-anatomy

Layer-by-layer visualizer for PyTorch models — Understand what each layer actually does.

PyPI License

Install

pip install torch-anatomy

Usage

from torch_anatomy import visualize_layers
from torchvision import models

model = models.resnet18(pretrained=True)
visualize_layers(
    model=model,
    input_image='dog.jpg',
    layers_to_show=['Conv2d', 'ReLU'],
    channels_per_layer=6,
    colormap='inferno',
    show_colorbar=True
)

Or from CLI:

torch-anatomy --model resnet18 --image dog.jpg

Features

  • Plug-and-play for any PyTorch CNN
  • Visualizes feature maps for key layers
  • Customizable channels, colormap, and more

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

torch_anatomy-0.1.1.tar.gz (4.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

torch_anatomy-0.1.1-py3-none-any.whl (5.2 kB view details)

Uploaded Python 3

File details

Details for the file torch_anatomy-0.1.1.tar.gz.

File metadata

  • Download URL: torch_anatomy-0.1.1.tar.gz
  • Upload date:
  • Size: 4.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.4

File hashes

Hashes for torch_anatomy-0.1.1.tar.gz
Algorithm Hash digest
SHA256 f088a4b070caab44aa7a645dcf70fc84fff986be9978f95a65323c95f4e45132
MD5 bdada9889491dabb34de233e14453c4a
BLAKE2b-256 a07881a3cea63c3a751248979cd22e68fb4703e47afde1d1ae74f6a11489bc6c

See more details on using hashes here.

File details

Details for the file torch_anatomy-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: torch_anatomy-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 5.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.4

File hashes

Hashes for torch_anatomy-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 26e9fefc88322934e0a1b78b29e6216d9e43a616a1438305d6b0a505f0f94c45
MD5 887817d58c824ed4f5b2ec33a39bbda7
BLAKE2b-256 b43c7b7f482832eddb1f44a33e234d8c01d1c123d8b23ee0e3f44d86ce3afd05

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page