All Projects → verifid → Mocr

verifid / Mocr

Licence: mit
Meaningful Optical Character Recognition from identity cards with Deep Learning.

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Mocr

Computer Vision Guide
📖 This guide is to help you understand the basics of the computerized image and develop computer vision projects with OpenCV. Includes Python, Java, JavaScript, C# and C++ examples.
Stars: ✭ 244 (+1184.21%)
Mutual labels:  opencv, optical-character-recognition
Facepixeler
A simple C# program that can automatically detect and blur faces in images. Uses OpenCV and EmguCV.
Stars: ✭ 5 (-73.68%)
Mutual labels:  opencv, face-detection
Add Christmas Hat
Add Christmas hat on one's head based on OpneCV and Dlib
Stars: ✭ 251 (+1221.05%)
Mutual labels:  opencv, face-detection
Opencv Course
Learn OpenCV in 4 Hours - Code used in my Python and OpenCV course on freeCodeCamp.
Stars: ✭ 185 (+873.68%)
Mutual labels:  opencv, face-detection
Libfaceid
libfaceid is a research framework for prototyping of face recognition solutions. It seamlessly integrates multiple detection, recognition and liveness models w/ speech synthesis and speech recognition.
Stars: ✭ 354 (+1763.16%)
Mutual labels:  opencv, face-detection
Marvel
Marvel - Face Recognition With Android & OpenCV
Stars: ✭ 199 (+947.37%)
Mutual labels:  opencv, face-detection
Face Tracking With Anime Characters
Hello! I have made a Python project where YURI from the game doki doki literature club accesses the webcam and stares directly into the players soul. Hope you enjoy!
Stars: ✭ 320 (+1584.21%)
Mutual labels:  opencv, face-detection
Hololenswithopencvforunityexample
HoloLens With OpenCVforUnity Example
Stars: ✭ 142 (+647.37%)
Mutual labels:  opencv, face-detection
Yoloface
Deep learning-based Face detection using the YOLOv3 algorithm (https://github.com/sthanhng/yoloface)
Stars: ✭ 339 (+1684.21%)
Mutual labels:  opencv, face-detection
Autocrop
😌 Automatically detects and crops faces from batches of pictures.
Stars: ✭ 320 (+1584.21%)
Mutual labels:  opencv, face-detection
Attendance Using Face
Face-recognition using Siamese network
Stars: ✭ 174 (+815.79%)
Mutual labels:  opencv, face-detection
Php Opencv
PHP extensions for OpenCV
Stars: ✭ 524 (+2657.89%)
Mutual labels:  opencv, face-detection
Proctoring Ai
Creating a software for automatic monitoring in online proctoring
Stars: ✭ 155 (+715.79%)
Mutual labels:  opencv, face-detection
Mozart
An optical music recognition (OMR) system. Converts sheet music to a machine-readable version.
Stars: ✭ 241 (+1168.42%)
Mutual labels:  opencv, optical-character-recognition
Opencv Facial Landmark Detection
使用OpenCV实现人脸关键点检测
Stars: ✭ 153 (+705.26%)
Mutual labels:  opencv, face-detection
Pigo
Fast face detection, pupil/eyes localization and facial landmark points detection library in pure Go.
Stars: ✭ 3,542 (+18542.11%)
Mutual labels:  opencv, face-detection
Robovision
AI and machine leaning-based computer vision for a robot
Stars: ✭ 126 (+563.16%)
Mutual labels:  opencv, face-detection
Animoji Animate
Facial-Landmarks Detection based animating application similar to Apple-Animoji™
Stars: ✭ 142 (+647.37%)
Mutual labels:  opencv, face-detection
Facemoji
😆 A voice chatbot that can imitate your expression. OpenCV+Dlib+Live2D+Moments Recorder+Turing Robot+Iflytek IAT+Iflytek TTS
Stars: ✭ 320 (+1584.21%)
Mutual labels:  opencv, face-detection
Opencv4nodejs
Nodejs bindings to OpenCV 3 and OpenCV 4
Stars: ✭ 4,444 (+23289.47%)
Mutual labels:  opencv, face-detection

mocr

.. image:: https://github.com/verifid/mocr/workflows/mocr%20ci/badge.svg :target: https://github.com/verifid/mocr/actions

.. image:: https://img.shields.io/pypi/v/mocr.svg :target: https://pypi.org/pypi/mocr/

.. image:: https://img.shields.io/pypi/pyversions/mocr.svg :target: https://pypi.org/project/mocr

.. image:: https://travis-ci.org/verifid/mocr.svg?branch=master :target: https://travis-ci.org/verifid/mocr

.. image:: https://codecov.io/gh/verifid/mocr/branch/master/graph/badge.svg :target: https://codecov.io/gh/verifid/mocr

Meaningful Optical Character Recognition from identity cards with Deep Learning.

Introduction

mocr is a library that can be used to detect meaningful optical characters from identity cards. Code base is pure Python and works with 3.x versions. It has some low level dependencies such as Tesseract. mocr uses a pre-trained east detector with OpenCV and applies it's Deep Learning techniques.

It has a pre-trained east detector inside the module and a custom trained model can be given as a parameter.

Prerequisites

  • Tessaract <https://github.com/tesseract-ocr/tesseract>_ must be installed on your computer before using OCR. Please check installation link <https://github.com/tesseract-ocr/tesseract#installing-tesseract>_ for details.
  • The other dependencies are listed on requirements.txt and will be installed when you install with pip.

Installation

From source

Install module using pip::

$ pip install mocr

Download the latest mocr library from: https://github.com/verifid/mocr

Install module using pip::

$ pip install -e .

Extract the source distribution and run::

$ python setup.py build
$ python setup.py install

Running Tests

The test suite can be run against a single Python version which requires pip install pytest and optionally pip install pytest-cov (these are included if you have installed dependencies from requirements.testing.txt)

To run the unit tests with a single Python version::

$ py.test -v

to also run code coverage::

$ py.test -v --cov-report html --cov=mocr

To run the unit tests against a set of Python versions::

$ tox

Sample Usage

  • text_recognition Initiating the TextRecognizer with identity image and then finding the texts with their frames:

.. code:: python

import os
from mocr import TextRecognizer

image_path = os.path.join('tests', 'data/sample_uk_identity_card.png')
east_path = os.path.join('mocr', 'model/frozen_east_text_detection.pb')

text_recognizer = TextRecognizer(image_path, east_path)
(image, _, _) = text_recognizer.load_image()
(resized_image, ratio_height, ratio_width, _, _) = text_recognizer.resize_image(image, 320, 320)
(scores, geometry) = text_recognizer.geometry_score(east_path, resized_image)
boxes = text_recognizer.boxes(scores, geometry)
results = text_recognizer.get_results(boxes, image, ratio_height, ratio_width)

# results: Meaningful texts with bounding boxes
  • face_detection:

.. code:: python

from mocr import face_detection

image_path = 'YOUR_IDENTITY_IMAGE_PATH'
face_image = face_detection.detect_face(image_path)
# face_image is the byte array detected and cropped image from original image

.. code:: python

from mocr import face_detection

video_path = 'YOUR_IDENTITY_VIDEO_PATH'
face_image = face_detection.detect_face_from_video(video_path)
# face_image is the byte array detected and cropped image from original video

CLI

Sample command line usage

  • Optical Character Recognition

.. code::

python -m mocr --image tests/data/sample_uk_identity_card.png --east tests/model/frozen_east_text_detection.pb
  • Face detection from image file

.. code::

python -m mocr --image-face 'tests/data/sample_de_identity_card.jpg'
  • Face detection from video file

.. code::

python -m mocr --video-face 'tests/data/face-demographics-walking.mp4'

Screenshots

Before

|image_before|

After

|image_after|

.. |image_before| image:: https://raw.githubusercontent.com/verifid/mocr/master/screenshots/sample_uk_identity_card.png .. |image_after| image:: https://raw.githubusercontent.com/verifid/mocr/master/screenshots/uk_identity_card_after_detection.png

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].