Giter Site home page Giter Site logo

tc_id_card_ocr's Introduction

Usage

Arguments

  • --folder_name: folder path
  • --neighbor_box_distance: Nearest box distance
  • --face_recognition: Face recognition method (dlib, ssd, haar)
  • --rotation_interval: Id card rotation interval in degrees
  • --ocr_method: ocr method (EasyOcr and TesseractOcr)

In Dlib and Haar face detection model, it is better to choose a rotation angle of less than 30 degrees, otherwise no face may be detected due to image inversion. Create a folder and put the ID card images in that folder

git clone [email protected]:musimab/Tc_ID_Card_OCR.git
mkdir images
python3 main.py --folder_name "images" --neighbor_box_distance 60 --face_recognition ssd --ocr_method EasyOcr --rotation_interval 60
pip install opencv-python-headless==4.5.3.56
pip install craft-text-detector
pip install easyocr

The result image and cropped regions will be saved to ./outputs by default. The json data will be saved to ./test by default.

TODOs

  1. deep learning based (Yolo SSD Faster Rcnn) identity card recognition model will be developed

Algorithm Pipeline

ocr_pip_update1

Input image

ori14_m2rot

Warped image

warped_img

CRAFT Character Density Map

txt_heat_map

Unet Output for character density map

maskem

Craft Output(red boxes) and Matched Boxes(blue boxes)

final_imgp

Ocr Output

Tc : 12345678909 Surname : MUSTAFA ALİ Name : YILMAZ DateofBirth : 07071999

Ocr Evaluation

The accuracy of the optical character system was evaluated according to 2 different criteria. The first of these is accuracy at the word level and the other is accuracy at the character level.

The evaluate.py function retrieves the predicted and actual values in json format

Character Level Comparision

  1. tc: 1303 / 1327 => 98.19 %
  2. surname: 805 / 816 => 98.65 %
  3. name: 742 / 746 => 99.46 %
  4. dateofbirth: 976 / 976 => 100.0 %

Word Level Comparision

  1. tc : 0.96 %
  2. surname : 0.91 %
  3. name : 0.95 %
  4. date: 1.0 %

Easy Ocr

https://github.com/sarra831/EasyOCR

tc_id_card_ocr's People

Contributors

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