Skip to content

A Deep Convolutional Approach Toward Farsi Character Recognition. Used for both machine printed and handwritten datasets

License

Notifications You must be signed in to change notification settings

kianenigma/DeepConvFarsiOCR

Repository files navigation

DeepConvFarsiOCR

A Deep Convolutional Approach Toward Farsi Character Recognition. Used for both machine printed and handwritten datasets.

Papers

Usage

Step1: Data

  • Download all images from this link.
  • Extract them to the home directory of this repository. After this, you should see PDB-Train and PDB-Test folders in your home directory.
  • ensure that run() function in convert.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.

Note that all files paths given to --src and --dest should be RELATIVE and should NOT include any / in them.

Step2: Data Sourcing

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 and test_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.

Step3: Train

  • 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.

About

A Deep Convolutional Approach Toward Farsi Character Recognition. Used for both machine printed and handwritten datasets

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages