MCPcopy Create free account
hub / github.com/tensorpack/tensorpack / preprocess

Method preprocess

examples/OpticalFlow/flownet_models.py:159–162  ·  view source on GitHub ↗
(self, left, right)

Source from the content-addressed store, hash-verified

157 raise NotImplementedError()
158
159 def preprocess(self, left, right):
160 x = tf.concat([left, right], axis=0) # 2CHW
161 rgb_mean = tf.reduce_mean(x, axis=[0, 2, 3], keep_dims=True)
162 return (x - rgb_mean) / 255.
163
164 def postprocess(self, prediction):
165 return resize(prediction * DISP_SCALE, mode='bilinear')

Callers 1

build_graphMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected