Code Monkey home page Code Monkey logo

kannada-character-recognition's Introduction

Handwritten Kannada Character Recognition

This application predicts the handwritten Kannada character using a pretrainet ResNet18 model. You can use the basic web app to draw the character on a sketchpad and get the prediction.

Demo

Alt Text

Dataset

For this model, I have used the Kannada handwritten characters from the Chars74k Dataset.

The dataset contains 657 classes and 25 images from each class(not a lot).

Getting Started

Code Requirements

Highly recommend a NVIDIA GPU in order to use this project, but will work on a CPU too. The program will run a lot slower when using CPU.

This project only works on Linux.(The fastai library only runs on Linux)

Recommend downloading all the below requirements using conda package manager which comes with Anaconda or Miniconda (Light version of Anaconda).

Python 3.6 and any greater version(Comes by default along with Anaconda).

The following lines contain required libraries and how to install them (Some of the packages below come by default with Anaconda) -

  1. fastai v1

    $ conda install -c fastai fastai
  2. Numpy

    $ conda install -c anaconda numpy
  3. PyTorch

    PyTorch is installed along with fastai when it is installed with conda.

  4. Flask

    $ conda install -c anaconda flask
  5. Pillow

    $ conda install -c anaconda pillow
  6. Jupyter Notebooks

    $ conda install -c anaconda notebook

Other optional requirements -

Sklearn

$ conda install -c anaconda scikit-learn

After installing the packages type the following command in order to update all the packages.

$ conda update --all

Training and Validation Data Preparation

  1. Download the Kannada Handwritten Images Datatset from the above link and extract the data from the zip file to current directory.
  2. Open jupyter notebook and run the Data Preparation.ipynb file to make the data ready for training the model.
  3. Make sure the data directory and labels.csv file is created.

Training The Model

Please run the above Training and Validation Data Preparation steps before training the model.

  1. After preparing the data, open jupyter notebook and run the Kannada Character Recognition.ipynb.
  2. The models saved in the notebook will be stored by default in a models directory.
  3. I have used a ResNet18 model architecture, using a bigger ResNet like ResNet34 etc might improve accuracy as well as F1 score.

Running The Web Application

Please run the above Training and Validation Data Preparation as well as Training the Model steps before running the web app.

  1. Run the create_classes_folder.py.

    $ python3 create_classes_folder.py
  2. Open a terminal in the webapp directory and run app.py

     $ python3 app.py

    This will start the flask server and the application can be used by opening the link displayed on the terminal.

License

This project is licensed under the MIT License.

MIT © Prithvi MK

kannada-character-recognition's People

Contributors

pmk21 avatar

Stargazers

 avatar  avatar  avatar

Watchers

 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.