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
Tracing and Observability with OpenFaaS

Tracing and Observability with OpenFaaS Today we will walk through how to add OpenTracing or OpenTelemetry with Grafana's Tempo. For this walk-through

Lucas Roesler 8 Nov 17, 2022
Program Input Nilai Mahasiswa Menggunakan Fungsi

PROGRAM INPUT NILAI MAHASISWA MENGGUNAKAN FUNGSI Nama : Maulana Reza Badrudin Nim : 312110510 Matkul : Bahas Pemograman DESKRIPSI Deklarasi dicti

Maulana Reza Badrudin 1 Jan 05, 2022
Never see escaped bytes in output.

Uniout It makes Python print the object representation in readable chars instead of the escaped string. Example from pprint import pprint lang

Mosky Liu 156 Oct 21, 2022
GibMacOS - Py2/py3 script that can download macOS components direct from Apple

Py2/py3 script that can download macOS components direct from Apple Can also now build Internet Recovery USB installers from Windows using dd and 7zip

CorpNewt 4.8k Jan 02, 2023
Notes on the Deep Learning book from Ian Goodfellow, Yoshua Bengio and Aaron Courville (2016)

The Deep Learning Book - Goodfellow, I., Bengio, Y., and Courville, A. (2016) This content is part of a series following the chapter 2 on linear algeb

hadrienj 1.7k Jan 07, 2023
Tucan Discord Token Generator - Remastered

TucanGEN-SRC Tucan Discord Token Generator - Remastered Tucan source made better by me. -- idk if it works anymore Includes: hCaptcha Bypass Automatic

Vast 8 Nov 04, 2022
An After Effects render queue for ShotGrid Toolkit.

AEQueue An After Effects render queue for ShotGrid Toolkit. Features Render multiple comps to locations defined by templates in your Toolkit config. C

Brand New School 5 Nov 20, 2022
NFT-Image-Generator - Utility to generate a large collection of unique images

NFT-Image-Generator Utility for creating a generative art collection from suppli

Sem Moolenschot 60 Dec 15, 2022
firefox session recovery

firefox session recovery

Ahmad Sadraei 5 Nov 29, 2022
Shared utility scripts for AI for Earth projects and team members

Overview Shared utilities developed by the Microsoft AI for Earth team The general convention in this repo is that users who want to consume these uti

Microsoft 38 Dec 30, 2022
Materials and information for my PyCascades 2021 Presentation

Materials and information for PyCascades 2021 Presentation: Sparking Creativity in LED Art with CircuitPython

GeekMomProjects 19 May 04, 2022
:snake: Complete C99 parser in pure Python

pycparser v2.20 Contents 1 Introduction 1.1 What is pycparser? 1.2 What is it good for? 1.3 Which version of C does pycparser support? 1.4 What gramma

Eli Bendersky 2.8k Dec 29, 2022
Example of my qtile config using the gruvbox colorscheme.

QTILE config Example of my qtile config using the gruvbox colorscheme. unicodes.py unicodes.py returns a widget.TextBox with a unicode. Currently it c

Imanuel Febie 31 Jan 02, 2023
🤖️ Plugin for Sentry which allows sending notification via DingTalk robot.

Sentry DingTalk Sentry 集成钉钉机器人通知 Requirments sentry = 21.5.1 特性 发送异常通知到钉钉 支持钉钉机器人webhook设置关键字 配置环境变量 DINGTALK_WEBHOOK: Optional(string) DINGTALK_CUST

1 Nov 04, 2021
A Python library that helps data scientists to infer causation rather than observing correlation.

A Python library that helps data scientists to infer causation rather than observing correlation.

QuantumBlack Labs 1.7k Jan 04, 2023
A place where the most basic, basic of python coding exists

python-basics A place where the most basic, basic of python coding exists As you can see, there are four folders and the best order to read is: appeti

Chuqin 2 Oct 05, 2022
How did Covid affect businesses?

NYC_Business_Analysis How did Covid affect businesses? COVID's effect on NYC businesses We all know that businesses in NYC have been affected by COVID

AK 1 Jan 15, 2022
CoreSE - basic of social Engineering tool

Core Social Engineering basic of social Engineering tool. just for fun :) About First of all, I must say that I wrote such a project because of my int

Hamed Mohammadvand 7 Jun 10, 2022
Yandex Media Browser

Браузер медиа для плагина Yandex Station Включайте музыку, плейлисты и радио на Яндекс.Станции из Home Assistant! Скриншот Корневой раздел: Библиотека

Alexander Ryazanov 35 Dec 19, 2022
A simple desktop application to scan and export Genshin Impact Artifacts.

「天目」 -- Amenoma 简体中文 | English 「天目流的诀窍就是滴水穿石的耐心和全力以赴的意志」 扫描背包中的圣遗物,并导出至 json 格式。之后可导入圣遗物分析工具( 莫娜占卜铺 、 MingyuLab 、 Genshin Optimizer 进行计算与规划等。 已支持 原神2.

夏至 475 Dec 30, 2022