Giter Club home page Giter Club logo

ml_idcard_segmentation-tf-keras's Introduction

Deprecated - Switched to Pytorch

ML_IDCard_Segmentation (Tensorflow / Keras)

Machine Learning Project to identify an ID Card on an image.

Objectives

The goal of this project is to recognize a ID Card on a photo, cut it out using semantic segmentation and to transform the perspective so that you get a front view of the ID Card. Optionally an OCR text recognition can be done in a later step. However, this is not yet planned in the scope of this project.

Additional Information

Dataset: MIDV-500
Tensorflow Version: GPU 1.5.0

Installation

  1. Create and activate a new environment.
conda create -n idcard python=3.6
source activate idcard
  1. Install Dependencies.
pip install -r requirements.txt

Download and Prepare Dataset

Download the image files (image and ground_truth).
Splits the data into training, test and validation data.

python prepare_dataset.py

Training of the neural network

python train.py

Show Jupyter Notebook for Test

jupyter notebook "IDCard Prediction Test.ipynb"

Test the trained model

python test.py test/sample1.png --output_mask=test/output_mask.png --output_prediction=test/output_pred.png --model=model.h5

Call python test.py --help for possible arguments.

Additional commands

Starts Tensorboard Visualisation.

tensorboard --logdir=logs/

Background Information

Model

A U-NET was used as the model. U-Net is a convolutional neural network that was developed for biomedical image segmentation at the Computer Science Department of the University of Freiburg, Germany. The network is based on the fully convolutional networkand its architecture was modified and extended to work with fewer training images and to yield more precise segmentations. Segmentation of a 512*512 image takes less than a second on a modern GPU.

IoU

Metrics

The Metric IoU (Intersection over Unit / Jaccard-Coefficient) was used to measure the quality of the model. The closer the Jaccard coefficient is to 1, the greater the similarity of the quantities. The minimum value of the Jaccard coefficient is 0.
IoU

Example:
IoU

Results for validation set (only trained on german id cards)

Accuracy:
99.87%

Intersection over Unit:
0.9939

Pipeline Example:
Pipeline

ml_idcard_segmentation-tf-keras's People

Contributors

dependabot[bot] avatar royalsolanki avatar tobiassteidle avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

ml_idcard_segmentation-tf-keras's Issues

Model.h5 is not included

Hi.
I wanted to use your code and do some testing of it and see if it is suitable for my project or not.
but the model file is not included and I was not able to find a link to it anywhere.
can you please send the model file for me so I can test the model without having to train it myself?

thanks a lot btw.

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.