| 41 | class ImageTransformer: public Transformer { |
| 42 | public: |
| 43 | void Setup(const TransformerConf& conf) override { |
| 44 | featurewise_center_ = conf.featurewise_center(); |
| 45 | featurewise_std_norm_ = conf.featurewise_std_norm(); |
| 46 | resize_height_ = conf.resize_height(); |
| 47 | resize_width_ = conf.resize_width(); |
| 48 | rescale_ = conf.rescale(); |
| 49 | horizontal_mirror_ = conf.horizontal_mirror(); |
| 50 | image_dim_order_ = conf.image_dim_order(); |
| 51 | |
| 52 | /// if crop_shape not contain 2 elements, ignore crop option. |
| 53 | if (conf.crop_shape_size() == 2) |
| 54 | crop_shape_ = {conf.crop_shape(0), conf.crop_shape(1)}; |
| 55 | } |
| 56 | |
| 57 | Tensor Apply(int flag, Tensor& input) override; |
| 58 |
nothing calls this directly
no test coverage detected