@Override public void setConf(Configuration conf) { super.setConf(conf); imageLoader = new ImageLoader(rows, cols); }
@Override public void initialize(Configuration conf, InputSplit split) throws IOException, InterruptedException { this.conf = conf; this.appendLabel = conf.getBoolean(APPEND_LABEL, false); this.height = conf.getInt(HEIGHT, height); this.width = conf.getInt(WIDTH, width); if ("imageio".equals(conf.get(IMAGE_LOADER))) { this.imageLoader = new ImageLoader(height, width); } else { this.imageLoader = new NativeImageLoader(height, width); } initialize(split); }
@Override public void initialize(Configuration conf, InputSplit split) throws IOException, InterruptedException { this.appendLabel = conf.getBoolean(APPEND_LABEL, false); this.labels = new ArrayList<>(conf.getStringCollection(LABELS)); this.height = conf.getInt(HEIGHT, height); this.width = conf.getInt(WIDTH, width); this.channels = conf.getInt(CHANNELS, channels); this.cropImage = conf.getBoolean(CROP_IMAGE, cropImage); if ("imageio".equals(conf.get(IMAGE_LOADER))) { this.imageLoader = new ImageLoader(height, width, channels, cropImage); } else { this.imageLoader = new NativeImageLoader(height, width, channels, imageTransform); } this.conf = conf; initialize(split); }