MCPcopy Index your code
hub / github.com/tensorpack/tensorpack / _dump_image

Method _dump_image

tensorpack/callbacks/graph.py:211–219  ·  view source on GitHub ↗
(self, im, idx=None)

Source from the content-addressed store, hash-verified

209 self.trainer.monitors.put_image(self.prefix, val)
210
211 def _dump_image(self, im, idx=None):
212 assert im.ndim in [2, 3], str(im.ndim)
213 fname = os.path.join(
214 self.log_dir,
215 self.prefix + '-ep{:03d}{}.png'.format(
216 self.epoch_num, '-' + str(idx) if idx else ''))
217 res = im * self.scale
218 res = np.clip(res, 0, 255)
219 cv2.imwrite(fname, res.astype('uint8'))
220
221
222class CheckNumerics(RunOp):

Callers 1

_triggerMethod · 0.95

Calls 2

joinMethod · 0.80
formatMethod · 0.80

Tested by

no test coverage detected