Code Monkey home page Code Monkey logo

sinhala-ocr's Introduction

Sinhala-OCR

This project is not an OCR. Instead, it contains a dataset of perfect test images of Sinhala characters that were generated, along with a test Convolutional Neural Network (CNN) based on LeNet. The purpose is to train the dataset to identify images that contain Sinhala characters. Caffe was used to implement and train the network. Feel free to use the provided dataset for your own purposes.

Directory Structure

.
├── commands.sh                 # contains useful Caffe commands
├── imgs                        # dataset
│   ├── adjusted                # training images with label files (TRAIN & TEST phase)
│   ├── labels_unicode.txt
│   └── unicode                 # a new dataset to evaluate the trained model
├── lenet.prototxt              # TEST model
├── lenet_solver.prototxt       # Caffe solver
├── lenet_train_test.prototxt   # TRAIN model
├── map.txt                     # mapping of labels / Unicode char / other Sinhala fonts
├── model                       # output models / solverstate directory
├── node_modules
├── README.md
├── test.py                     # Python script to evaluate the trained model
└── textgen.js                  # script to generate Sinhala characters

Generating Database Files

Training

Once you have defined lenet_train_test.prototxt and configured solver lenet_solver.prototxt, start training using the following commands. You can view commands.sh file for useful Caffe commands.

Evaluating

Use test.py to test the trained model on your new images.

Generate Sinhala Characters

Installation

To generate Sinhala characters, you need to install the following dependencies:

sudo apt-get install libcairo2-dev libjpeg8-dev libpango1.0-dev libgif-dev build-essential g++

Running the Script

Make sure all the fonts mentioned in the code are installed on your system and that font names don't have any spaces or escape characters. To generate Sinhala characters, run the following commands:

npm install
node textgen.js

The created image will be saved in imgs/ directory.

sinhala-ocr's People

Contributors

wathmal avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.