Giter Site home page Giter Site logo

asad-ismail / fruits-classfication Goto Github PK

View Code? Open in Web Editor NEW
2.0 1.0 0.0 193 KB

Fruit classification tensorflow

CMake 0.20% C++ 1.25% Python 4.95% Shell 0.39% Dockerfile 0.20% Jupyter Notebook 93.00%
tensorflow fruits sagemaker classification cpp sagemaker-deployment tflite-conversion cpp-inference optimization

fruits-classfication's Introduction

Fruits-classfication training and deployment (Tensorflow 2.x)

Goal

The purpose of this repo is to provoide complete pipeline from training to deployment in local machine as well as Amazon sagemaker and deployment of trained model in some embedded hardware like Rasberrypie using cpp and tflite as well as in cloud using amazon sagemaker.

Features

  1. Train, Prediction and Evaluation scripts for classifcation model
  2. Conversion from tensorflow model to tensorflow lite
  3. cpp files to use tensorflow lite model with option of using CPU or GPU delegates (The script can be used in some embedded device for inference)
  4. Model training and deployment in AWS sagemaker for cloud training and deployment

The repostiry contains tensorflow implementation of fruits 360 classification dataset which contains 131 coategories of fruits (https://github.com/Horea94/Fruit-Images-Dataset)

Example images from dataset

r_67_100 50_100 65_100 244_100

Training

  1. Download the dataset from the above link
  2. To train the model python train.py --train_dir [path to train set] --test_dir [path to test set] --out_dir [path to output dir]

Results

After 30 epochs Inception V3 model achieves 99.418% accuracy on test set

Infer on image

To test on one image python pred_one.py --weights [path to weight file] --input [path to input image]

Conversion to tflite model

To convert to tflite model python convert_to_tflite.py --weights_dir [path to .hdf5 file] --test_dir [path to test set]

Testing tf model@ x86 Intel G4550, GTX1080TI

size

Run time performance

See cpp-inference for cpp inference files

  1. cpp inference (XNNPACK delegate for CPU)(1 thread)

inference

  1. cpp inference (GPU delegate)(cpu 1 thread)

cpp

For more detailed benchmarking see https://github.com/tensorflow/tensorflow/tree/master/tensorflow/lite/tools/benchmark

fruits-classfication's People

Contributors

asad-ismail avatar

Stargazers

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