Tensorboard plugin 3d with python

Overview

tensorboard-plugin-3d

Overview

In this example, we render a run selector dropdown component. When the user selects a run, it shows a preview of all scalar data for tags within it. For a complete guide to plugin development, see ADDING_A_PLUGIN.

Screenshot

All files under static/* are served as static assets, with the frontend entry point being static/index.js. The plugin backend serves scalar summaries (e.g. values written by tf.summary.scalar) from runs within the --logdir passed to TensorBoard.

Getting started

To generate some scalar summaries, you can run the demo.py. Alternatively, you can write scalars from your own Python program to a log directory, using Keras callbacks or tf.summary.scalar with a summary file writer.

Copy the directory tensorboard/examples/plugins/example_raw_scalars into a desired folder. In a virtualenv with TensorBoard installed, run:

python setup.py develop

This will link the plugin into your virtualenv. Then, just run

tensorboard --logdir /tmp/runs_containing_scalars

and open TensorBoard to see the raw scalars example tab.

After making changes to static/index.js or adding assets to static/, you can refresh the page in your browser to see your changes. Modifying the backend requires restarting the TensorBoard process.

To uninstall, you can run

python setup.py develop --uninstall

to unlink the plugin from your virtualenv, after which you can also delete the tensorboard_plugin_example_raw_scalars.egg-info/ directory that the original setup.py invocation created.

Comments
  • ZeroDivisionError for a Simple Example

    ZeroDivisionError for a Simple Example

    This plugin produces a ZeroDivisonError for a simple example. I installed the most recent version (1.0.3) from pypi. I have attached the full stack trace and the relevant portion of the error is the following:

    ...
     File "/home/ubuntu/anaconda3/envs/pytensorboard3d/lib/python3.8/site-packages/tensorboard_plugin_3d/plugin.py", line 80, in _serve_image
        data = self._find_next_images(1)
    File "/home/ubuntu/anaconda3/envs/pytensorboard3d/lib/python3.8/site-packages/tensorboard_plugin_3d/plugin.py", line 173, in _find_next_images
        self.current_run = (int(idx) - 1) % len(self._all_runs)
    ZeroDivisionError: integer division or modulo by zero
    

    Steps to reproduce:

    1. Environment setup. The pip installation step is taken from here:
    conda create -n pytensorboard3d python=3.8 -y
    conda activate pytensorboard3d
    
    pip install -q "monai-weekly[gdown, nibabel, tqdm, ignite]"
    pip install -q matplotlib
    pip install -q tensorboard-plugin-3d
    
    1. Write a simple cube to the summary:
    from monai.visualize.img2tensorboard import plot_2d_or_3d_image
    import torch
    from torch.utils.tensorboard import SummaryWriter
    
    def make_white_cube_batch():
        x = torch.zeros((8, 1, 100, 100, 100))
        x[:, :, 25:75, 25:75, 25:75] = 1
        return x
    
    log_dir = '/home/ubuntu/foo'
    sw = SummaryWriter(log_dir=log_dir)
    
    batch = make_white_cube_batch()
    plot_2d_or_3d_image(data=batch, step=1, writer=sw, tag='White Cube')
    
    1. Run tensorboard from the terminal:
    tensorboard --logdir /home/ubuntu/foo --port 8080
    

    Expected behaviour:

    1. Tensorboad 3D tab appears in tensorboard.
    2. If you navigate manually to Tensorboard 3D in the plugin tab, a volume would be rendered.

    Actual Behaviour:

    1. Tensorboad 3D tab does not appear in tensorboard.
    2. If you navigate manually to Tensorboard 3D in the plugin tab, you get spinning wheel with the following message: Tensorboard 3D is loading, please wait....
    3. There is an error in the stack trace as mentioned earlier.
    image
    opened by siavashk 5
  • Bundle viewer

    Bundle viewer

    Bundle the itk-vtk-viewer with the python package

    WIP: Relies on Kitware/itk-vtk-viewer#475. Will need to update viewer version once that PR is in.

    Fixes #53

    opened by bnmajor 5
  • feat(toggle data): Add ability to toggle current data

    feat(toggle data): Add ability to toggle current data

    Support the ability to toggle between all of the images available in the logdir.

    This branch provides some changes that work around existing bugs that prevent simply updating the image/label in the viewer. Instead the viewer object is re-instantiated each time that the data is toggled and the state from the previous data is saved and re-applied to the next image and/or label.

    Relies on changes in InsightSoftwareConsortium/itk-viewer-material-ui#17

    https://user-images.githubusercontent.com/51238406/153461775-2ea2df00-f237-46f0-9ab3-d4a55f3064fa.mp4

    opened by bnmajor 3
  • Doc fixes

    Doc fixes

    1. Fix the image links in the README so that they will also work for PyPi documentation
    2. Update the Spleen Segmentation screenshots. Instead of showing the output model alone, add the input label so that you can see the difference between the input and output model.
    3. Re-organize the images into appropriate sub-directories for the docs and notebooks.
    4. Add some example images to the docs as well
    opened by bnmajor 2
  • Bump deps

    Bump deps

    This bumps the itk-vtk-viewer CDN to 11.12.4 and the itk-viewer-material-ui to 0.2.0 which resolves the array buffer error that I was seeing on data toggle. Tested against the cached spleen notebook, the unet notebook, and the example notebook that I had previously created with the reproducible errors.

    This also fixes a bug with the color range that always set the range from the previous dataset without accounting for the new data range. The range is now computed from the max of both range min values and the min of both range max values.

    The plugin will be ready to be bumped to v1.0.0 after these changes are merged in.

    opened by bnmajor 1
  • Make work offline

    Make work offline

    • Bundle itk-vtk-viewer
      • Integrate the itk-vtk-viewer WebPack configuration equivalent:

    https://github.com/Kitware/itk-vtk-viewer/blob/8925e32bfe8b34e72138b8ceb6840a087a739d68/webpack.config.js#L73-L116

    • We can possibly exclude the io WebAssembly modules if they are unnecessary.
    opened by thewtex 0
  • feat(image order): Serve the first image first

    feat(image order): Serve the first image first

    Previously the most recent image was served first to match the pattern used by the TensorBoard Images plugin. Now that we have the ability to toggle through all output I think it makes more sense to start at the beginning.

    @thewtex Let me know what you think about this change. If we should keep what we have that is fine. I am just finding it odd (even though I know the logic behind it) to always start with the last image now that we can toggle. Since most of the time people will likely be writing out all the images at once they would likely always start at the last image. Plus if there has been an update it's simple enough to jump to that now with the arrows (which do support fast clicking) or typing in the exact image number.

    opened by bnmajor 0
  • Image load order

    Image load order

    • Load the most recent image(s) first
    • Require the tag flag for plot_2d_or_3d_image in order to associate the correct data as the label
      • Update the notebooks to use this approach
    • Update the docs with more explicit instructions for how to create images in the notebook that can be used with the plugin
    opened by bnmajor 0
Releases(v1.0.3)
  • v1.0.3(May 5, 2022)

    What's Changed

    • build(package_data): Make sure that the itk directory is included by @bnmajor in https://github.com/KitwareMedical/tensorboard-plugin-3d/pull/59

    Full Changelog: https://github.com/KitwareMedical/tensorboard-plugin-3d/compare/v1.0.2...v1.0.3

    Source code(tar.gz)
    Source code(zip)
  • v1.0.2(May 4, 2022)

    What's Changed

    • Bundle viewer by @bnmajor in https://github.com/KitwareMedical/tensorboard-plugin-3d/pull/57
    • Update Docs by @bnmajor in https://github.com/KitwareMedical/tensorboard-plugin-3d/pull/58

    Full Changelog: https://github.com/KitwareMedical/tensorboard-plugin-3d/compare/v1.0.1...v1.0.2

    Source code(tar.gz)
    Source code(zip)
  • v1.0.1(Apr 12, 2022)

    What's Changed

    • style(debug): Remove debug statement by @bnmajor in https://github.com/KitwareMedical/tensorboard-plugin-3d/pull/55
    • feat(progress): Add progress circle and text while plugin is loading by @bnmajor in https://github.com/KitwareMedical/tensorboard-plugin-3d/pull/56

    Full Changelog: https://github.com/KitwareMedical/tensorboard-plugin-3d/compare/v1.0.0...v1.0.1

    Source code(tar.gz)
    Source code(zip)
  • v1.0.0(Apr 7, 2022)

    What's Changed

    • Bump deps by @bnmajor in https://github.com/KitwareMedical/tensorboard-plugin-3d/pull/54

    Full Changelog: https://github.com/KitwareMedical/tensorboard-plugin-3d/compare/v0.1.6...v1.0.0

    Source code(tar.gz)
    Source code(zip)
  • v0.1.6(Mar 30, 2022)

    What's Changed

    • docs(notebooks): Add example notebooks with cached data by @bnmajor in https://github.com/KitwareMedical/tensorboard-plugin-3d/pull/45
    • style(css): Position toggle in right corner by @bnmajor in https://github.com/KitwareMedical/tensorboard-plugin-3d/pull/46
    • feat(image order): Serve the first image first by @bnmajor in https://github.com/KitwareMedical/tensorboard-plugin-3d/pull/47
    • Add jump to first/last buttons by @bnmajor in https://github.com/KitwareMedical/tensorboard-plugin-3d/pull/49
    • style(spelling): Tensorboard -> TensorBoard by @bnmajor in https://github.com/KitwareMedical/tensorboard-plugin-3d/pull/50
    • fix(walrus operator): Remove walrus operator by @bnmajor in https://github.com/KitwareMedical/tensorboard-plugin-3d/pull/51

    Full Changelog: https://github.com/KitwareMedical/tensorboard-plugin-3d/compare/v0.1.5...v0.1.6

    Source code(tar.gz)
    Source code(zip)
  • v0.1.5(Feb 23, 2022)

    What's Changed

    • Itk viewer dep by @bnmajor in https://github.com/KitwareMedical/tensorboard-plugin-3d/pull/40
    • Image load order by @bnmajor in https://github.com/KitwareMedical/tensorboard-plugin-3d/pull/39
    • feat(toggle data): Add ability to toggle current data by @bnmajor in https://github.com/KitwareMedical/tensorboard-plugin-3d/pull/42
    • feat(brats): Add the brats_segmentation_3d notebook by @bnmajor in https://github.com/KitwareMedical/tensorboard-plugin-3d/pull/41

    Full Changelog: https://github.com/KitwareMedical/tensorboard-plugin-3d/compare/v0.1.4...v0.1.5

    Source code(tar.gz)
    Source code(zip)
  • v0.1.4(Feb 3, 2022)

    What's Changed

    • doc(README): Add installation instructions by @thewtex in https://github.com/KitwareMedical/tensorboard-plugin-3d/pull/36
    • Doc fixes by @bnmajor in https://github.com/KitwareMedical/tensorboard-plugin-3d/pull/37
    • doc(README): Add CI badge by @thewtex in https://github.com/KitwareMedical/tensorboard-plugin-3d/pull/38

    Full Changelog: https://github.com/KitwareMedical/tensorboard-plugin-3d/compare/v0.1.3...v0.1.4

    Source code(tar.gz)
    Source code(zip)
  • v0.1.3(Jan 27, 2022)

    What's Changed

    • doc(Sphinx): Use pydata-sphinx-theme by @thewtex in https://github.com/KitwareMedical/tensorboard-plugin-3d/pull/33
    • doc(README): Add Zenodo DOI badge by @thewtex in https://github.com/KitwareMedical/tensorboard-plugin-3d/pull/31
    • fix(setup_requires): Require setuptools-scm by @bnmajor in https://github.com/KitwareMedical/tensorboard-plugin-3d/pull/35
    • Readme updates by @bnmajor in https://github.com/KitwareMedical/tensorboard-plugin-3d/pull/34

    Full Changelog: https://github.com/KitwareMedical/tensorboard-plugin-3d/compare/v0.1.2...v0.1.3

    Source code(tar.gz)
    Source code(zip)
  • v0.1.2(Jan 27, 2022)

    What's Changed

    • docs(long_description): Set long description content type by @bnmajor in https://github.com/KitwareMedical/tensorboard-plugin-3d/pull/29
    • docs(versioning): Sync package version with git tag using setuptools_scm by @bnmajor in https://github.com/KitwareMedical/tensorboard-plugin-3d/pull/30

    Full Changelog: https://github.com/KitwareMedical/tensorboard-plugin-3d/compare/v0.1.1...v0.1.2

    Source code(tar.gz)
    Source code(zip)
  • v0.1.1(Jan 25, 2022)

    What's Changed

    • fix(publish): Add missing checkout to publish package by @bnmajor in https://github.com/KitwareMedical/tensorboard-plugin-3d/pull/25
    • docs(version): Bump to 0.1.1 by @bnmajor in https://github.com/KitwareMedical/tensorboard-plugin-3d/pull/26

    Full Changelog: https://github.com/KitwareMedical/tensorboard-plugin-3d/compare/v0.1.0...v0.1.1

    Source code(tar.gz)
    Source code(zip)
  • v0.1.0(Jan 25, 2022)

    What's Changed

    • First UI pass by @bnmajor in https://github.com/KitwareMedical/tensorboard-plugin-3d/pull/1
    • Read tensorboard logs by @bnmajor in https://github.com/KitwareMedical/tensorboard-plugin-3d/pull/2
    • Colab changes by @bnmajor in https://github.com/KitwareMedical/tensorboard-plugin-3d/pull/3
    • DOC: Add PyPI badge by @thewtex in https://github.com/KitwareMedical/tensorboard-plugin-3d/pull/7
    • Add python-publish yaml file by @bnmajor in https://github.com/KitwareMedical/tensorboard-plugin-3d/pull/11
    • Testing by @bnmajor in https://github.com/KitwareMedical/tensorboard-plugin-3d/pull/10
    • docs(demo): Add demo notebook and colab badge by @bnmajor in https://github.com/KitwareMedical/tensorboard-plugin-3d/pull/13
    • docs(setup.py): Add short and long description as well as url by @bnmajor in https://github.com/KitwareMedical/tensorboard-plugin-3d/pull/14
    • docs: Add documentation by @bnmajor in https://github.com/KitwareMedical/tensorboard-plugin-3d/pull/12
    • Notebook updates by @bnmajor in https://github.com/KitwareMedical/tensorboard-plugin-3d/pull/18
    • style(spacing): Remove excess padding at top of UI by @bnmajor in https://github.com/KitwareMedical/tensorboard-plugin-3d/pull/17
    • fix(docs link): Fix the README documentation link by @bnmajor in https://github.com/KitwareMedical/tensorboard-plugin-3d/pull/23
    • fix(image processing): Remove expand_animations flag by @bnmajor in https://github.com/KitwareMedical/tensorboard-plugin-3d/pull/24

    New Contributors

    • @bnmajor made their first contribution in https://github.com/KitwareMedical/tensorboard-plugin-3d/pull/1
    • @thewtex made their first contribution in https://github.com/KitwareMedical/tensorboard-plugin-3d/pull/7

    Full Changelog: https://github.com/KitwareMedical/tensorboard-plugin-3d/commits/v0.1.0

    Source code(tar.gz)
    Source code(zip)
Owner
KitwareMedical
Kitware is the lead developer of CMake, ParaView, ITK, and VTK. We also develop special-purpose algorithms and applications, featured here.
KitwareMedical
Drop-down terminal for GNOME

Guake 3 README Introduction Guake is a python based dropdown terminal made for the GNOME desktop environment. Guake's style of window is based on an F

Guake 4.1k Dec 25, 2022
Python script to combine the statistical results of a TOPAS simulation that was split up into multiple batches.

topas-merge-simulations Python script to combine the statistical results of a TOPAS simulation that was split up into multiple batches At the top of t

Sebastian Schäfer 1 Aug 16, 2022
Mannaggia is a python application to praise or more likely to curse the saints

Mannaggia-py 👼 Remember Mannaggia? This is a Python remake of it, with new features. mannaggia is a python application to praise or more likely to cu

Christian Visintin 9 Aug 12, 2022
management tool for systemd-nspawn containers

nspctl nspctl, management tool for systemd-nspawn containers. Why nspctl? There are different tools for systemd-nspawn containers. You can use native

Emre Eryilmaz 5 Nov 27, 2022
This project recreates the R-based RCy3 Cytoscape Automation library as a Python package.

Python library for calling Cytoscape Automation via CyREST

Cytoscape Consortium 40 Dec 22, 2022
[arXiv 2020] Video Representation Learning with Visual Tempo Consistency

Video Representation Learning with Visual Tempo Consistency [Paper] [Project Page] News Full codebae is coming soon Pretained Models For now, we provi

DeciForce: Crossroads of Machine Perception and Autonomy 24 Nov 23, 2022
Developed a website to analyze and generate report of students based on the curriculum that represents student’s academic performance.

Developed a website to analyze and generate report of students based on the curriculum that represents student’s academic performance. We have developed the system such that, it will automatically pa

VIJETA CHAVHAN 3 Nov 08, 2022
Integer sets where all subsets have unique sums

Evil Sums Generation of sets of numbers where all constituents are recoverable from a partial sum.

Charlotte 5 Sep 24, 2022
More routines for operating on iterables, beyond itertools

More Itertools Python's itertools library is a gem - you can compose elegant solutions for a variety of problems with the functions it provides. In mo

2.8k Jan 02, 2023
Certipy is a Python tool to enumerate and abuse misconfigurations in Active Directory Certificate Services (AD CS).

Certipy Certipy is a Python tool to enumerate and abuse misconfigurations in Active Directory Certificate Services (AD CS). Based on the C# variant Ce

ollypwn 1.3k Jan 01, 2023
Trashselected - Plugin for fman.io to move files that has been selected in fman to trash

TrashSelected Plugin for fman.io to move files that has been selected in fman to

1 Feb 04, 2022
Stop python warnings, no matter what!

SHUTUP - Stop python warnings, no matter what! Sometimes you just can't mute python warnings. Use this library to solve this. Installation pip install

80 Jan 04, 2023
Python library and cli util for https://www.zerochan.net/

Zerochan Library for Zerochan.net with pics parsing and downloader included! Features CLI utility for pics downloading from zerochan.net Library for c

kiriharu 10 Oct 11, 2022
Purge your likes and wall comments from VKontakte. Set yourself free from your digital footprint.

vk_liberator Regain liberty in the cruel social media world. This program assists you with purging your metadata from Russian social network VKontakte

20 Jun 11, 2021
Basic-Killfeed - A simple DayZ Console Killfeed

Basic-Killfeed A simple DayZ Console Killfeed. Setup Install Python Version 3.10

Nick 1 Apr 25, 2022
A package selector for building your confy nest

Hornero A package selector for building your comfy nest About Hornero helps you to install your favourite packages on your fresh installed Linux distr

Santiago Soler 1 Nov 22, 2021
The bidirectional mapping library for Python.

bidict The bidirectional mapping library for Python. Status bidict: has been used for many years by several teams at Google, Venmo, CERN, Bank of Amer

Joshua Bronson 1.2k Dec 31, 2022
Extended functionality for Namebase past their web UI

Namebase Extended Extended functionality for Namebase past their web UI.

RunDavidMC 12 Sep 02, 2022
Domoticz-hyundai-kia - Domoticz Hyundai-Kia plugin for Domoticz home automation system

Domoticz Hyundai-Kia plugin Author: Creasol https://www.creasol.it/domotics For

Creasol 7 Aug 03, 2022
IPython: Productive Interactive Computing

IPython: Productive Interactive Computing Overview Welcome to IPython. Our full documentation is available on ipython.readthedocs.io and contains info

IPython 15.6k Dec 31, 2022