MCPcopy Create free account
hub / github.com/OpenPTrack/open_ptrack_v2 / set_mean

Method set_mean

rtpose_wrapper/python/caffe/io.py:236–260  ·  view source on GitHub ↗

Set the mean to subtract for centering the data. Parameters ---------- in_ : which input to assign this mean. mean : mean ndarray (input dimensional or broadcastable)

(self, in_, mean)

Source from the content-addressed store, hash-verified

234 self.raw_scale[in_] = scale
235
236 def set_mean(self, in_, mean):
237 """
238 Set the mean to subtract for centering the data.
239
240 Parameters
241 ----------
242 in_ : which input to assign this mean.
243 mean : mean ndarray (input dimensional or broadcastable)
244 """
245 self.__check_input(in_)
246 ms = mean.shape
247 if mean.ndim == 1:
248 # broadcast channels
249 if ms[0] != self.inputs[in_][1]:
250 raise ValueError('Mean channels incompatible with input.')
251 mean = mean[:, np.newaxis, np.newaxis]
252 else:
253 # elementwise mean
254 if len(ms) == 2:
255 ms = (1,) + ms
256 if len(ms) != 3:
257 raise ValueError('Mean shape invalid')
258 if ms != self.inputs[in_][1:]:
259 raise ValueError('Mean shape incompatible with input shape.')
260 self.mean[in_] = mean
261
262 def set_input_scale(self, in_, scale):
263 """

Callers 7

__init__Method · 0.80
__init__Method · 0.80
TYPED_TESTFunction · 0.80
TYPED_TESTFunction · 0.80
GaussianFillerTestMethod · 0.80
TYPED_TESTFunction · 0.80
SetUpMethod · 0.80

Calls 1

__check_inputMethod · 0.95

Tested by 5

TYPED_TESTFunction · 0.64
TYPED_TESTFunction · 0.64
GaussianFillerTestMethod · 0.64
TYPED_TESTFunction · 0.64
SetUpMethod · 0.64