Movies, and engineering.

Menu Close

Tag: mxnet

MXNet – Image iteration using mx.io.ImageRecordIter

In one of the previous posts I’ve described how to create RecordIO data set for MXNet.

Now I wanted to share an example how to iterate over the RecordIO data set. This example in many ways similar to the how to tutorial that are available on the mxnet github page. But nonetheless, I’ve decided it could be a logical continuation of a previous post and could probably help someone.

When we have a RecordIO set of images, we can use mx.io.ImageRecordIter to load and decode the data.

If you have prepared your image training set using im2rec.py correctly, you will see 4 little pictures plotted on the graph.

MXNet im2rec.py

MXNet provides a Python utility to create RecordIO packages of data that are supported by framework’s data iterators.

https://github.com/dmlc/mxnet/blob/master/tools/im2rec.py

In order to create a rec file, you first need to make a list of files using this command:

After you get .lst files, lets create a record set.

Record objects will be about the same size as the data that being used for the objects.

here we eliminating –list argument so the script will be working on .rec files.

At the end of its execution, it should display something like

and in the folder where you have your dataset you will see files

and same for train and validation sets.

 

Enjoy!

© 2017 Movies, and engineering. . All rights reserved.

Theme by Anders Norén.