GithubHelp home page GithubHelp logo

harishkumar-295 / bank-note-authentication-end-to-end-implementation-with-docker Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 267 KB

Bank Note Authentication end to end implementation with Docker | Building UI with Flasgger | Deployed with Streamlit| Flask

Jupyter Notebook 84.26% Dockerfile 0.57% Python 15.17%
flask streamlit flasgger docker swagger pickle random-forest

bank-note-authentication-end-to-end-implementation-with-docker's Introduction

Bank-note-Authentication-end-to-end-implementation-with-docker

Bank Note Authentication end to end implementation with Docker | Building UI with Flasgger | Deployed with Streamlit | Flask

money img

Dataset available on kaggle from this link.

About the data

Data were extracted from images that were taken from genuine and forged banknote-like specimens. For digitization, an industrial camera usually used for print inspection was used. The final images have 400x 400 pixels. Due to the object lens and distance to the investigated object gray-scale pictures with a resolution of about 660 dpi were gained. Wavelet Transform tool were used to extract features from images. The problem statement is quiet simple:

Problem statement

as it is described in about the data section, There is a gray scale pictures of notes with a resolution of about 660 dpi. Wavelet Transform tool were used to extract features from images.we have four features['Variance', 'skewness', 'curtosis', 'entropy'] and we have to predict wheather Bank Note is authentic or not.

I Have used RandomForestClassifier to predict wheather the note is authetic or not as problem is not that complex,fitted the data and predict with 99% accuracy and created pickle file to save the model .

The pickle module implements a fundamental, but powerful algorithm for serializing and de-serializing a Python object structure.and additonally pickle is a binary file format

I have used flask to create a Web API

Let's dockerize our machine learning Model as REST API using Flask :
  1. Create Dockerfile

    FROM continuumio/anaconda3:4.4.0     # Creating base image which is created by docker hub
    COPY . /usr/app                      # Cpoying the working directory in root user directory
    EXPOSE 5000                          # Exposing the PORT number
    WORKDIR usr/app                      # Telling the container where is the working directory
    RUN pip install -r requirements.txt  # installing required packages to run 
    CMD python app.py                    # Command to run our app
    

    Creat your requirements.txt file by following command

    pip freeze > requirements.txt
    
  2. Build docker image

    docker build -t "<app_name>" . 
    --------------------------------
    Eg: docker build -t money_api .
    
  3. Run the Docker container after build

    docker run -p 5000:5000 "<app_name>"    # -p : to make the port available for the browser externally
    
  4. Check your all running container

    docker ps   # You can check you container id , status and name et
    

    If you want to access the ip address for a specific running container

    docker inspect "<Container_id>"
    

    Kill and remove container

    docker rm "<container_id>" -f
    
  • OUTPUT of this perticular project Running on Docker container

    -I have used flasgger for the UI pip install flasgger

    Flasgger bank note authentication

Deploying using Streamlit

first of all You have to install streamlit in you environment using below command

pip install streamlit`

then run the flasgger_app.py

streamlit run flasgger_app.py

OUTPUT : Streamlit Bank note authentication

bank-note-authentication-end-to-end-implementation-with-docker's People

Contributors

harishkumar-295 avatar

Watchers

 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.