Created
October 22, 2017 21:08
Sample code to load the images from a directory to be used to feed a neural network using DeepLearning4J
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ParentPathLabelGenerator labelGenerator = new ParentPathLabelGenerator(); | |
File coinsTrainRootDir = Paths.get("/path/to/my/mycooldataset/train").toFile(); | |
InputSplit trainData = new FileSplit(coinsTrainRootDir, BaseImageLoader.ALLOWED_FORMATS, new Random()); | |
ImageRecordReader trainReader = new ImageRecordReader(IMG_WIDTH, IMG_HEIGHT, 3, labelGenerator); | |
trainReader.initialize(trainData); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment