class_docstr: Saves a series of images.
  
  The `.add()` method takes a ``(N,..., C, H, W)`` array as an input,
  and ``num_images`` of ``[H, W, :min(3, C)]`` are saved into
  the monitor folder for each interval.
  
  The values are displayed and/or output to the file
  ``<name>/{iter}-{image index}.png``.
  
  Example:
  
  .. code-block:: python
  
      import numpy as np
      m = Monitor('tmp.monitor')
      mi = MonitorImage('noise', m, interval=2, num_images=2)
      x = np.random.randn(10, 3, 8, 8)
      for i in range(10):
          mi.add(i, x)
  
  Args:
      name (str): Name of the monitor. Used in the log.
      monitor (~nnabla.monitor.Monitor): Monitor class instance.
      interval (int): Interval of flush the outputs.
      num_images (int): Number of images to be saved in each iteration.
      normalize_method (function): A function that takes a NCHW format image minibatch
          as :obj:`numpy.ndarray`. The function should define a normalizer which
          map any inputs to a range of [0, 1]. The default normalizer normalizes
          the images into min-max normalization.
class_docstr_tok: ["Saves","a","series","of","images",".","The","`",".add","(",")","`","method","takes","a","``","(","N",",","...",",","C",",","H",",","W",")","``","array","as","an","input",",","and","``","num_images","``","of","``","[","H",",","W",",",":","min","(","3",",","C",")","]","``","are","saved","into","the","monitor","folder","for","each","interval",".","The","values","are","displayed","and\/or","output","to","the","file","``","<","name",">","\/","{","iter","}","-","{","image","index","}",".png","``",".","Example",":","..","code-block",":",":","python","import","numpy","as","np","m","=","Monitor","(","'tmp.monitor","'",")","mi","=","MonitorImage","(","'noise","'",",","m",",","interval=2",",","num_images=2",")","x","=","np.random.randn","(","10",",","3",",","8",",","8",")","for","i","in","range","(","10",")",":","mi.add","(","i",",","x",")","Args",":","name","(","str",")",":","Name","of","the","monitor",".","Used","in","the","log",".","monitor","(","~nnabla.monitor.Monitor",")",":","Monitor","class","instance",".","interval","(","int",")",":","Interval","of","flush","the","outputs",".","num_images","(","int",")",":","Number","of","images","to","be","saved","in","each","iteration",".","normalize_method","(","function",")",":","A","function","that","takes","a","NCHW","format","image","minibatch","as",":","obj",":","`","numpy.ndarray","`",".","The","function","should","define","a","normalizer","which","map","any","inputs","to","a","range","of","[","0",",","1","]",".","The","default","normalizer","normalizes","the","images","into","min-max","normalization","."]
code: def __init__(
      self,
      name,
      monitor,
      interval=1000,
      verbose=True,
      num_images=16,
      normalize_method=None,
  ):
      self.name = name
      self.interval = interval
      self.verbose = verbose
      self.normalize_method = normalize_method
      if normalize_method is None:
          self.normalize_method = self.default_normalize_method
      self.num_images = num_images
      self.save_dir = os.path.join(
          monitor.save_path, name.replace(" ", "-")
      )
      try:
          os.makedirs(self.save_dir)
      except OSError:
          pass
  
imports: from __future__ import print_function
  import numpy
  import os
  import time
  from nnabla.logger import logger
label_desc: Use image node_id 1 to create a new MonitorImage object from inherited base classes: object with example: obj = MonitorImage(name, monitor, interval, verbose, num_images, normalize_method)