Set the input channel order for e.g. RGB to BGR conversion as needed for the reference ImageNet model. N.B. this assumes the channels are the first dimension AFTER transpose. Parameters ---------- in_ : which input to assign this channel order
(self, in_, order)
| 201 | self.transpose[in_] = order |
| 202 | |
| 203 | def set_channel_swap(self, in_, order): |
| 204 | """ |
| 205 | Set the input channel order for e.g. RGB to BGR conversion |
| 206 | as needed for the reference ImageNet model. |
| 207 | N.B. this assumes the channels are the first dimension AFTER transpose. |
| 208 | |
| 209 | Parameters |
| 210 | ---------- |
| 211 | in_ : which input to assign this channel order |
| 212 | order : the order to take the channels. |
| 213 | (2,1,0) maps RGB to BGR for example. |
| 214 | """ |
| 215 | self.__check_input(in_) |
| 216 | if len(order) != self.inputs[in_][1]: |
| 217 | raise Exception('Channel swap needs to have the same number of ' |
| 218 | 'dimensions as the input channels.') |
| 219 | self.channel_swap[in_] = order |
| 220 | |
| 221 | def set_raw_scale(self, in_, scale): |
| 222 | """ |
no test coverage detected