A Deep Convolutional Approach Toward Farsi Character Recognition. Used for both machine printed and handwritten datasets.
- Download all images from this link.
- Extract them to the home directory of this repository. After this, you should see
PDB-Train
andPDB-Test
folders in your home directory. - ensure that
run()
function inconvert.images.lua
is not commented. - execute
convert.images.lua
with the following parameters:
th convert.images.lua --src PDB-Test --dest PDB-Test --bin PDB_Test.bin
and
th convert.images.lua --src PDB-Train --dest PDB-Train --bin PDB_Train.bin
- These commands will
- Convert all bpm images in
--src
directory into PNG and store them in--dest
- extract labels from file names and store them with them images in
--bin
binary file.
- Convert all bpm images in
Note that all files paths given to
--src
and--dest
should be RELATIVE and should NOT include any/
in them.
This step converts the raw data stored in binary files to dp:DataSource
. This operation is done using data.source.lua
and it is called internally by cnn.v2.lua
. Hence, it cannot accepts parameters and should be manually adjusted. The following parameters are important:
local validRatio = .5
local train_bin = './PDB_Train.bin'
local test_bin = './PDB_Test.bin'
train_bin
andtest_bin
should be qual to--dest
parameters in the previous section.validRatio
indicates what portion of the test dataset should be used for cross-validation.
- run
th cnn.v2.lua --progress
. See the source file for more commands and options.
Always use the
--id
parameter. This name will be used to store the model and logs.