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

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

            # Create an Image object
            img_sum = tf.compat.v1.Summary.Image(encoded_image_string=s.getvalue(),
                                       height=img.shape[0],
                                       width=img.shape[1])
            # Create a Summary value
            img_summaries.append(tf.compat.v1.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)
Log a list of images.
Log a list of images.
Log a list of images .
def image_summary(self, tag, images, step):
        tag=self.tag(tag)
        img_summaries = []
        for i, img in enumerate(images):
            s = BytesIO()
            scipy.misc.toimage(img).save(s, format="png")
            img_sum = tf.compat.v1.Summary.Image(encoded_image_string=s.getvalue(),
                                       height=img.shape[0],
                                       width=img.shape[1])
            img_summaries.append(tf.compat.v1.Summary.Value(tag='%s/%d' % (tag, i), image=img_sum))
        summary = tf.Summary(value=img_summaries)
        self.writer.add_summary(summary, step)
def image_summary ( self , tag , images , step ) : tag = self . tag ( tag ) img_summaries = [ ] for i , img in enumerate ( images ) : s = BytesIO ( ) scipy . misc . toimage ( img ) . save ( s , format = "png" ) img_sum = tf . compat . v1 . Summary . Image ( encoded_image_string = s . getvalue ( ) , height = img . shape [ 0 ] , width = img . shape [ 1 ] ) img_summaries . append ( tf . compat . v1 . Summary . Value ( tag = '%s/%d' % ( tag , i ) , image = img_sum ) ) summary = tf . Summary ( value = img_summaries ) self . writer . add_summary ( summary , step )
Log a list of images.
Log a list of images .
"""Log a list of images.""" # Write the image to a string # Create an Image object # Create a Summary value # Create and write Summary
self
tag
images
step