GithubHelp home page GithubHelp logo

graham-broughton / mushroom-classifier Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 1.0 318.25 MB

License: MIT License

Jupyter Notebook 65.77% Python 2.88% HTML 30.89% Dockerfile 0.06% Makefile 0.21% HCL 0.10% Shell 0.10%

mushroom-classifier's Introduction

SMS based Mushroom Classifier

Table of Contents

About the Project

Hunting for mushrooms and foraging in general has become much more popular over the last few years. Unfortunately, people still make deadly misidentifications. This classifier does not aim to replace diligent identification, but to be used as a tool to put you in the right direction. Contained in this repo is all the code required to replicate the app yourself, including downloading the data, training and deployment. The app is deployed using Twilio webhooks to reply to MMS messages with an SMS containing the top 1-3 predictions based on how confident the model is. The training protocol results in top1 and top3 validation accuracies of 93% and 98%, respectively, for 467 species over 100 000 images of resolution (224, 224).

TODO List

  • train model to an acceptable accuracy
  • create working docker image
  • implement fastapi in docker image and deploy on Google Run
  • logic to save hash of phone number and received image in BigQuery
  • make a CI/CD pipeline with parameterized env vars
  • create tests
  • web scraper for MO images
  • implement terraform?

Getting Started

Prerequisites

  1. Ensure you have a working python 3.11 installation
  2. Create a Twilio account and buy a phone number
  3. Make a Google Cloud account & save the main service account credentials to the root of the repo
  1. Install Poetry
  2. Set up a Weights and Biases account for MLOPs
  3. Create an account with ngrok for local testing

Installation

  1. Clone this repository:

    git clone https://github.com/Graham-Broughton/Mushroom-Classifier.git

  2. Create an .env file in the root directory using the .envsample file as a template

Usage

As stated previously, this project was designed to be very easy to use while still permitting broad user configurability. In this section, we will cover the makefile commands provided and areas for user configurations.

Important Make Commands

  1. make init Runs make dotenv and build: copies the .env to needed directories and installs the required packages
  2. make -j2 datasets_of_interest Download & extracts the required datasets (FGVCX 2018 & 2021). You will need around 700Gb of disk space for this step. The data strain is much lower when preprocessing is complete, so you can create a new VM with much less disk space afterwords.
  3. make tfrecords Removes non-fungal images and processes and combines the associated json data from the datasets into a useable dataframe. This dataframe is then used for processing the images and important metadata into TFRecords using default resolution or your choice.
  4. make local_deploy Download the latest model version from Weights and Biases and deploy it locally using ngrok.
  5. make cloud_run_build Runs make get_deploy_model to download the latest model from wandb then builds a docker image with your chosen tag
  6. make cloud_run_deploy Runs make cloud_run_build to package the app then deploys it on Google Cloud Run
  7. make cloud_run_delete Deletes the deployed service

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.