GithubHelp home page GithubHelp logo

kurshakuz / nomeroff-net Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ria-com/nomeroff-net

0.0 1.0 0.0 128.83 MB

Nomeroff Net. Automatic numberplate recognition system.

License: GNU General Public License v3.0

Python 0.59% HTML 0.24% Jupyter Notebook 98.99% JavaScript 0.17% Shell 0.01% Dockerfile 0.02%

nomeroff-net's Introduction

Nomeroff Net. Automatic numberplate recognition system

Nomeroff Net. Automatic numberplate recognition system. Version 1.0.0

Introduction

Nomeroff Net is an opensource python license plate recognition framework based on the application of a segmentation neural network and cusomized OCR-module powered by GRU architecture.

The project is now at the initial stage of development, write to us if you are interested in helping us in the formation of a dataset for your country.

Version 1.0 2.5x faster Nomeroff Net 0.4.x! This improvement was achieved by replacing Mask RCNN with a CenterMask2 (more modern and high-speed implementation of the instance segmaentation task).

Installation

Installation from Source (Linux)

Nomeroff Net requires Python >= 3.6 and opencv 3.4 or latest

Clone Project and clone related projects

git clone https://github.com/ria-com/nomeroff-net.git
cd nomeroff-net
git clone https://github.com/youngwanLEE/centermask2.git
For Centos, Fedora and other RedHat-like OS:
# for Opencv
yum install libSM

# for pycocotools install 
yum install python3-devel 

# ensure that you have installed gcc compiler
yum install gcc
For Ubuntu and other Debian-like OS:
# ensure that you have installed gcc compiler
apt-get install gcc

# for opencv install
apt-get install -y libglib2.0
apt-get install -y libsm6
apt-get install -y libfontconfig1 libxrender1
apt-get install -y libxtst6

# for pycocotools install (Check the name of the dev-package for your python3)
apt-get install python3.6-dev
install python requirments
pip3 install torch==1.7
pip3 install PyYAML==5.3
pip3 install 'git+https://github.com/facebookresearch/detectron2.git'
pip3 install torchvision==0.8
pip3 install Cython
pip3 install numpy
pip3 install -r requirements.txt

Installation from Source (Windows)

On Windows, you must have the Visual C++ 2015 build tools on your path. If you don't, make sure to install them from here:

Nomeroff Net. Automatic numberplate recognition system

Then, run visualcppbuildtools_full.exe and select default options:

Nomeroff Net. Automatic numberplate recognition system

Hello Nomeroff Net

# Specify device
import os
os.environ["CUDA_VISIBLE_DEVICES"] = "0" 
os.environ["TF_FORCE_GPU_ALLOW_GROWTH"]="true"

# Import all necessary libraries.
import numpy as np
import sys
import matplotlib.image as mpimg

# NomeroffNet path
NOMEROFF_NET_DIR = os.path.abspath('../')
sys.path.append(NOMEROFF_NET_DIR)

# Import license plate recognition tools.
from NomeroffNet import  Detector
from NomeroffNet import  filters
from NomeroffNet import  RectDetector
from NomeroffNet import  OptionsDetector
from NomeroffNet import  TextDetector
from NomeroffNet import  textPostprocessing

# load models
rectDetector = RectDetector()

optionsDetector = OptionsDetector()
optionsDetector.load("latest")

textDetector = TextDetector.get_static_module("eu")()
textDetector.load("latest")

nnet = Detector()
nnet.loadModel(NOMEROFF_NET_DIR)

# Detect numberplate
img_path = 'images/example2.jpeg'
img = mpimg.imread(img_path)

# Generate image mask.
cv_imgs_masks = nnet.detect_mask([img])
    
for cv_img_masks in cv_imgs_masks:
    # Detect points.
    arrPoints = rectDetector.detect(cv_img_masks)
    
    # cut zones
    zones = rectDetector.get_cv_zonesBGR(img, arrPoints, 64, 295)

    # find standart
    regionIds, stateIds, countLines = optionsDetector.predict(zones)
    regionNames = optionsDetector.getRegionLabels(regionIds)
    
    # find text with postprocessing by standart  
    textArr = textDetector.predict(zones)
    textArr = textPostprocessing(textArr, regionNames)
    print(textArr)
    # ['JJF509', 'RP70012']


Hello Jupyter Nomeroff Net

Online Demo

In order to evaluate the quality of work of Nomeroff Net without spending time on setting up and installing, we made an online form in which you can upload your photo and get the recognition result online

AUTO.RIA Numberplate Dataset

All data on the basis of which the training was conducted is provided by RIA.com. In the following, we will call this data the AUTO.RIA Numberplate Dataset.

We will be grateful for your help in the formation and layout of the dataset with the image of the license plates of your country. For markup, we recommend using VGG Image Annotator (VIA)

Nomeroff-Net Mask-RCNN Example: Nomeroff-Net Mask-RCNN Example
Mask detection example
Key points detection example

AUTO.RIA Numberplate Options Dataset

The system uses several neural networks. One of them is the classifier of numbers at the post-processing stage. It uses dataset AUTO.RIA Numberplate Options Dataset.

The categorizer accurately (99%) determines the country and the type of license plate. Please note that now the classifier is configured mainly for the definition of Ukrainian numbers, for other countries it will be necessary to train the classifier with new data.

Nomeroff-Net OCR Example

AUTO.RIA Numberplate OCR Datasets

As OCR, we use a specialized implementation of a neural network with GRU layers, for which we have created several datasets:

If we did not manage to update the link on dataset you can find the latest version here

This gives you the opportunity to get 98% accuracy on photos that are uploaded to AUTO.RIA project

Nomeroff-Net OCR Example


Number plate recognition example

Contributing

Contributions to this repository are welcome. Examples of things you can contribute:

  • Training on other datasets.
  • Accuracy Improvements.

Credits

Links

nomeroff-net's People

Contributors

apelsyn avatar dimabendera avatar serhii-hladiholov avatar rm-yakovenko avatar azimovs avatar workoverflow avatar dependabot[bot] avatar

Watchers

James Cloos 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.