Skip to content
This repository has been archived by the owner on Feb 6, 2023. It is now read-only.

Visualize images without Trainer #206

Merged
merged 13 commits into from
Dec 4, 2018

Conversation

disktnk
Copy link
Member

@disktnk disktnk commented Nov 12, 2018

This PR provides summary.image method and summary.reporter to visualize images on browser. Current ChainerUI has already provided (undocumented)ImageReporter, the extension collects images cached by summary.image, split register phase and write phase, to reduce file writing cost. In many case, however, registering images and write tend to do in same time such as evaluation time, this design confuses.

Usage

from chainerui import summary
summary.image(x, out=out_path)
summary.image(x, out=out_path)

x, x2 are converted as PNG format and show on a browser. out_path is required to same as log file directory.

timestamp image
2018-11-12T12:00:00 [x image]
2018-11-12T12:00:01 [x2 image]
from chainerui import summary
with summary.reporter(out=out_path) as r:
    r.image(x)
    r.image(x2)

x and x2 are converted as PNG format and show in same row.

timestamp image_0 image_1
2018-11-12T12:00:00 [x image] [x2 image]

Pros

  1. more simplified usage
  2. no dependency to Trainer

Cons

  1. epoch and iteration are not set automatically
  2. set out_put every time

To deal with Cons. 1, timestamp key is added automatically to distinguish images roughly. Additionally any key-pair discription can be set on the function, like summary.image(x, out_path, epoch=10)

To be ease Cons 2, prepare chainerui.summary.set_out(out_path) method to set out_path once.

@disktnk disktnk requested a review from ofk November 12, 2018 09:17
@disktnk disktnk added this to the v0.8.0 milestone Nov 12, 2018
@disktnk
Copy link
Member Author

disktnk commented Nov 13, 2018

I put quick examples on https://github.com/disktnk/chainerui-demo-20180609/tree/master/vae

@disktnk disktnk changed the title [WIP]Visualize images without Trainer Visualize images without Trainer Nov 16, 2018
@disktnk disktnk requested review from makky3939 and gky360 November 19, 2018 00:31
Copy link
Contributor

@makky3939 makky3939 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. I tried this p-r using example scripts

Copy link
Contributor

@gky360 gky360 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🙇

@disktnk disktnk merged commit ffcb3fe into chainer:master Dec 4, 2018
@disktnk disktnk deleted the fix/remove-image-reporter branch December 4, 2018 02:49
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants