(self, tag, images, step)
Log a list of images.
Log a list of images.
Log a list of images .
def image_summary(self, tag, images, step):
        """Log a list of images."""

        img_summaries = []
        for i, img in enumerate(images):
            # Write the image to a string
            try:
                s = StringIO()
            except ImportError:
                s = BytesIO()
            scipy.misc.toimage(img).save(s, format="png")

            # Create an Image object
            img_sum = tf.Summary.Image(encoded_image_string=s.getvalue(),
                                       height=img.shape[0],
                                       width=img.shape[1])
            # Create a Summary value
            img_summaries.append(tf.Summary.Value(tag='%s/%d' % (tag, i),
                                                  image=img_sum))

        # Create and write Summary
        summary = tf.Summary(value=img_summaries)
        self.writer.add_summary(summary, step)
def image_summary ( self , tag , images , step ) : img_summaries = [ ] for i , img in enumerate ( images ) : # Write the image to a string try : s = StringIO ( ) except ImportError : s = BytesIO ( ) scipy . misc . toimage ( img ) . save ( s , format = "png" ) # Create an Image object img_sum = tf . Summary . Image ( encoded_image_string = s . getvalue ( ) , height = img . shape [ 0 ] , width = img . shape [ 1 ] ) # Create a Summary value img_summaries . append ( tf . Summary . Value ( tag = '%s/%d' % ( tag , i ) , image = img_sum ) ) # Create and write Summary summary = tf . Summary ( value = img_summaries ) self . writer . add_summary ( summary , step )