Normlize image by given mean and std.
| 195 | |
| 196 | |
| 197 | class NormalizeImage(object): |
| 198 | """Normlize image by given mean and std. |
| 199 | """ |
| 200 | |
| 201 | def __init__(self, mean, std): |
| 202 | self.__mean = mean |
| 203 | self.__std = std |
| 204 | |
| 205 | def __call__(self, sample): |
| 206 | sample["image"] = (sample["image"] - self.__mean) / self.__std |
| 207 | |
| 208 | return sample |
| 209 | |
| 210 | |
| 211 | class PrepareForNet(object): |
no outgoing calls
no test coverage detected