Example #1
0
 def writeImages(self, inputs):
     if self.imageExists():
         return
     self.logger.debug("Creating example images for %s..." % (self.getBaseName()))
     imgs = self.xform.getExamples(inputs)
     for i in range(len(imgs)):
         img = imgs[i]
         img.save(os.path.join(self.getDir(), self.getImageName(i)))
         Thumbnailer.getInstance(self.experiment).makeThumb(img, os.path.join(self.getDir(), self.getThumbName(i)))
Example #2
0
 def getExampleThumb(self, i, count):
     if ((i < 0) or (i >= count)):
         return ""
     else:
         fname = os.path.join(self.getDir(False), self.getThumbName(i))
         url = Thumbnailer.getInstance(self.experiment).getURL(fname)
         return "<a href='%s'><img src='%s' border=1></a>" % (self.getPageName(i), url)