Giter Club home page Giter Club logo

fashion-mnist-flask's Introduction

Please star this repo if you are using it as a reference. Thanks.

Classification Models

This is a PoC for creating a pipeline that does the following -

  • Training a model. Here it is done on Fashion MNIST and MNIST datasets.
  • Load the saved weights.
  • Expose an API using Flask.

System Configuration Used

  • OS - Ubuntu 18.04 LTS
  • Python Version - 3.6
  • Conda Version - Miniconda3-latest-Linux-x86_64
  • Shell Flavour - ZSH (Optional)
  • Tensorflow Version - 1.13.1
  • Keras Version - keras-2.2.4

How to run?

  • Install Miniconda from here.
  • Run the following command
conda update conda
  • Clone the repository
  • Install dependencies from environment.yml file
conda env create -f environment.yml
  • Activate your environment
conda activate classification_model

Refer the doc here for knowing what all flavours are supported.

  • Visit src/train folder and run the following command
python3 fashion_mnist.py

You will get a h5 model and a json file as an output in the model folder. You can do the same thing for MNIST dataset.

  • Now go to src/server and start the server using the following command
python3 server.py

For MNIST dataset go to pre-process folder and change json_file and load_weights accordingly

  • Open a new temrinal and visit src/test for images and test according to the dataset you loaded by using the following command
curl -X POST -F '[email protected]'  http://localhost:5000/predict

For other images, in place of trouser.jpg add the name of that new input image.

Output format

Numbers are returned in both the cases. In case of MNIST dataset, it directly corresponds to the predicted number whereas in case of Fashion MNIST dataset, it corresponds to the class number. For more information refer this link.

NOTE : Since python2 is being deprecated and is going to go out of service on January 1st, 2020, hence the code was made for python3. Depending on the default version of python in your system you may or may not have to run the command as python3 fashion_mnist.py. It can be python fashion_mnist.py given that default version is python3.

fashion-mnist-flask's People

Contributors

sayak119 avatar

Watchers

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