Code Monkey home page Code Monkey logo

fastapi_banknote_classification_csv's Introduction

BANKNOTE AUTHENTICATION APP

Simple FastAPI application that detects whether a banknote is authentic or not.

About the dataset

The dataset was taken from this kaggle dataset

From the kaggle dataset page: 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. Dataset can be used for Binary Classification sample problems

The dataset is a .CSV file containing five columns:

  1. variance - (float) variance of Wavelet Transformed image
  2. skewness - (float) skewness of Wavelet Transformed image
  3. curtosis - (float) curtosis of Wavelet Transformed image
  4. entropy - (float) entropy of Wavelet Transformed image
  5. class - (integer) label 0 or 1

About the model

Simple random forest model is fit on the dataset. Jupyter notebook provided in repository. The model is then saved as a pickle file and loaded in the FastAPI and Streamlit apps.

Deployment

There are three important files in the repository related to deployment:

  • app.py: FastAPI code
  • main.py: Streamlit code
  • Dockerfile: builds python3.8-slim image with necessary dependencies to run FastAPI app. Automatically starts FastAPI server everytime you run the container.

Commands

To build Docker image:

cd <folder_containing_Dockerfile>
docker build -t <image_name> .

FastAPI server runs by default on port 8000. Change port number insidemain.py. To start FastAPI server:

python main.py

To run Streamlit app (runs on port 8501 by default):

streamlit run app.py --server.port <port_number>

Tutorial

Followed this YouTube playlist.

fastapi_banknote_classification_csv's People

Contributors

sohamtiwari3120 avatar

Watchers

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