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

Method put_image

tensorpack/callbacks/monitor.py:175–188  ·  view source on GitHub ↗

Put an image. Args: name (str): val (np.ndarray): 2D, 3D (HWC) or 4D (NHWC) numpy array of images in range [0,255]. If channel is 3, assumed to be RGB.

(self, name, val)

Source from the content-addressed store, hash-verified

173 self._dispatch(lambda m: m.process_summary(s))
174
175 def put_image(self, name, val):
176 """
177 Put an image.
178
179 Args:
180 name (str):
181 val (np.ndarray): 2D, 3D (HWC) or 4D (NHWC) numpy array of images
182 in range [0,255]. If channel is 3, assumed to be RGB.
183 """
184 assert isinstance(val, np.ndarray)
185 arr = image_to_nhwc(val)
186 self._dispatch(lambda m: m.process_image(name, arr))
187 s = create_image_summary(name, arr)
188 self._dispatch(lambda m: m.process_summary(s))
189
190 def put_event(self, evt):
191 """

Callers 3

_triggerMethod · 0.80
_triggerMethod · 0.80
_trigger_epochMethod · 0.80

Calls 5

_dispatchMethod · 0.95
image_to_nhwcFunction · 0.85
create_image_summaryFunction · 0.85
process_imageMethod · 0.45
process_summaryMethod · 0.45

Tested by

no test coverage detected