r/computervision • u/Dev-Table • Aug 09 '25
Showcase Interactive visualization of Pytorch computer vision models within notebooks
I have been building an open source package called torchvista (Github) which lets you interactively visualize the forward pass of large Pytorch models within web-based notebooks like Jupyter, Colab and VSCode notebook.
You can install it via `pip`, and interactively visualize any Pytorch model with one line of code.
I also have some demos of some computer vision models if you have to check them out first:
I'm keen to hear your feedback if you try it out! It's on Github with instructions.
Thank you
7
u/_michaeljared Aug 10 '25
Oh wow. can I reference this in a course I am teaching on machine vision? We go over most of these models and the interactive visualization is much nicer than a static image.
4
4
1
u/BarnardWellesley Aug 10 '25
How is this different from tensor board?
3
u/Dev-Table Aug 10 '25
I think it's different in these ways:
Torchvista shows you a partial visualization even when there are errors in the forward pass (like a tensor shape mismatch error). When that happens, it still shows a partial graph along with the stack trace to help debug. Here is how it looks when that happens. Whereas with Netron this wouldn't be possible because you wouldn't be able to export the model in the first place if it threw errors during the forward pass.
Just (IMHO) better UX in general, lower barrier to entry (especially for beginners), and a greater degree of visualization control (For example, you can optimize the depth to which you want to trace the model). In the future, I'm also planning to add support for "rolling" where if a portion of the model is repeated 10 times (like in repeating encoder blocks in a transformer), it would just show it as one block with a loopback x10 sign.
2
u/No_Efficiency_1144 Aug 10 '25
It is true as mentioned that others exist but it’s a nice presentation of this. i always like these
2
1
u/herocoding Aug 11 '25
This is really great!! And compares to Netron very well!! Thank you for shareing.
1
16
12
u/Effect__XS Aug 10 '25
Why not use netron? It's available as app or open directly in browser https://netron.app