Giter Site home page Giter Site logo

tf's Introduction

Tensorflow

Tensorflow Installation (on Windows)

Tensorflow Sample Code

Intro - Tensorflow Session & Tensorboard

  • jupyter notebook to run intro.ipynb
  • run tensorboard : tensorboard --logdir=./
  • use Chrome to open http://localhost:6006

Basic Machine Learning

  • one neuron network : python3 easy_net.py
  • ten neurons network: python3 hidden_net.py

MNIST : Handwritten Number Recognition

  • plot data : python3 mnist_plotdata.py
  • DNN : python3 mnist.py
  • CNN : python3 mnist_cnn.py
  • load model to predict :
    python3 mnist_cnn_test.py (test data)
    python3 mnist_cnn_image.py (image file)
    python3 mnist_cnn_webcam.py (camera)

Fashion-MNIST : Fashion Wearing Recongition

  • CNN : python3 fashionmnist_cnn.py

Emotion Detection : Facial Expression Recognition

  • Download the FER-2013 dataset from here and unzip it under data folder.
  • change directory name from data/data to data/fer2013
  • To train the model, run python3 emotion_detection.py --mode train
  • To detect facial expression, run python3 emotion_detection.py --mode detect

Object Detection

  • Download Google Images
    python3 download_google_images.py bread
  • Download a pretrained model
    Download a pretrained model from TensorFlow Model Zoo
    cd ~/models/research/object_detection
    tar zxvf ~/Downloads/ssd_mobilenet_v2_coco_2018_03_29.tar.gz
  • Run Object_Detection
    cp ~/tf/Object_detection_*.py .
    python3 Object_detection_image.py
    python3 Object_detection_webcam.py
  • Export Frozen_Inference_Graph
    cp ~/tf/export_inference_graph.sh .
    ./export_inference_graph.sh training model.ckpt-????
  • Convert TF model to TFLite (for Android App)
    cp ~/tf/tflite_*.sh . (copy shell files)
    ./tflite_export.sh (convert from model.ckpt to tflite_graph.pb)
    ./tflite_convert_pb.sh (convert tflite_graph.pb to model.tflite)
    ./tflite_convert_pb_quant.sh (convert tflite_graph.pb to model_quant.tflite)

Transfer Learning (on Windows)

  • Transfer Learning using Keras Mobilenet V2
    cd ~/tf
    python3 download_google_images.py "blue tit" (download dataset)
    python3 download_google_images.py crow (download dataset)
    python3 transfer_learning_mobilenetv2.py (transfer learning)
    python3 transfer_learning_image.py (load model and test image file)
    python3 transfer_learning_webcam.py (load model and input from webcam )
  • Convert Keras model to TFLite (for Android App)
    ./tflite_convert_h5.sh (convert tl_mobilenetv2.h5 to tl_mobilenetv2.tflite)
    ./tflite_convert_h5_quant.sh (convert tl_mobilenetv2.h5 to tl_mobilenetv2_quant.tflite)

Edge TPU (USB Accelerator on RPi3B)

  • Convert _quant.tflite to _quant_edgetpu.tflite
  • upload tl_mobilenetv2_quant.tflite to EdgeTPU online compiler
  • download _quant_edgetput.tflite and copy to RPi3
  • On RPi3B
    cd ~
    git clone https://github.com/rkuo2000/tf (clone sample codes)
    cd ~/tf
    vi model/bird_labels.txt (create label file)
  • To test the model :
    python3 edgetpu_classify_webcam.py --model model/tl_mobilenetv2_quant.tflite --label model/bird_labels.txt
    python3 edgetpu_classify_image.py --model model/tl_mobilenetv2_quant.tflite --label model/bird_labels.txt

tf's People

Contributors

rkuo2000 avatar

Stargazers

 avatar

Watchers

James Cloos 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.