Normlize image by given mean and std.
| 123 | |
| 124 | |
| 125 | class NormalizeImage(object): |
| 126 | """Normlize image by given mean and std. |
| 127 | """ |
| 128 | |
| 129 | def __init__(self, mean, std): |
| 130 | self.__mean = mean |
| 131 | self.__std = std |
| 132 | |
| 133 | def __call__(self, sample): |
| 134 | sample["image"] = (sample["image"] - self.__mean) / self.__std |
| 135 | |
| 136 | return sample |
| 137 | |
| 138 | |
| 139 | class PrepareForNet(object): |
nothing calls this directly
no outgoing calls
no test coverage detected