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

Method deprocess

rtpose_wrapper/python/caffe/io.py:164–185  ·  view source on GitHub ↗

Invert Caffe formatting; see preprocess().

(self, in_, data)

Source from the content-addressed store, hash-verified

162 return caffe_in
163
164 def deprocess(self, in_, data):
165 """
166 Invert Caffe formatting; see preprocess().
167 """
168 self.__check_input(in_)
169 decaf_in = data.copy().squeeze()
170 transpose = self.transpose.get(in_)
171 channel_swap = self.channel_swap.get(in_)
172 raw_scale = self.raw_scale.get(in_)
173 mean = self.mean.get(in_)
174 input_scale = self.input_scale.get(in_)
175 if input_scale is not None:
176 decaf_in /= input_scale
177 if mean is not None:
178 decaf_in += mean
179 if raw_scale is not None:
180 decaf_in /= raw_scale
181 if channel_swap is not None:
182 decaf_in = decaf_in[np.argsort(channel_swap), :, :]
183 if transpose is not None:
184 decaf_in = decaf_in.transpose(np.argsort(transpose))
185 return decaf_in
186
187 def set_transpose(self, in_, order):
188 """

Callers

nothing calls this directly

Calls 3

__check_inputMethod · 0.95
copyMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected