Git Product home page Git Product logo

lunozip / churrossamosaclassifier Goto Github PK

View Code? Open in Web Editor NEW

This project forked from sebastian-schuchmann/churrossamosaclassifier

0.0 0.0 0.0 78.83 MB

A template to train and deploy your own food models with PyTorch/FastAI. As an example I have built a churros-samosa-classifier.

Home Page: https://churros-or-samosa.site

HTML 0.20% JavaScript 0.13% Python 0.06% CSS 0.13% Dockerfile 0.01% Jupyter Notebook 99.46%

churrossamosaclassifier's Introduction

Churros Samosa Classifier

Tools used

This was built with PyTorch/FastAI for the Machine Learning part and Flask as a Webserver. For containerization and easy deployment I use Docker. The dataset in use is the Food-101 Dataset but I chose to only use two of the foods contained there.

How to use

You can easily use this as a template for your own models.

Train your own Model

Open In Colab

Go ahead and open the Notebook in Colab with a simple press of a button! Most steps will be described in detail there. Just follow along!

You can decide which two foods you want to classify by changing:

#Deciding which two foods we want to classify
labelA = 'samosa'
labelB = 'churros'

Of course it is also possible to train all the foods contained in the Food-101 Dataset but in order to achieve this you have to modify the code a bit.

At the end of the notebook it will download an export.pkl file, which is your model.

Deploy your own Model

Deploying your on model is a easy as replacing the model (server/export.pkl) with your own model. Of course, it makes sense to also modify the HTML/CSS a bit to your liking.

Command to launch the container:

docker build -t churros_samosa_classifier . && docker run --rm -it -p 5000:5000 churros_samosa_classifier

Then you can deploy the Container to any Cloud Provider of your choosing.

I recommend Render, which is what I used for my deployment but everything else should work fine, too.

Steps for deploying on Render

  • Fork this repository

  • Replace the model (export.pkl)

  • Change the HTML and CSS to your liking

  • In the Render Dashboard create a new Web Service

  • Link your repository

  • Make sure Docker is selected

  • Done!

churrossamosaclassifier's People

Contributors

sebastian-schuchmann 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.