Code Monkey home page Code Monkey logo

not-hotdog's Introduction

中文文档

Not Hotdog

Personal implementation of Jin Yang's Not Hotdog app in HBO's Silicon Valley.

seefood

App developed with:

Model trained on:

Links


Building the Model

1. Collecting data set

I used COCO dataset 2014 to train the model. COCO dataset contains 80 thing classes, one of which is "hot dog".

I created a Python script (./yolo/coco2yolo.py) to extract all the hot dog images (800+ from train and 400+ from val) and convert the annotations to yolo format.

2. Training Yolov2 Tiny

The model is trained with a single class "hotdog" using this fork of darknet.

darknet.exe partial yolov2-tiny.cfg yolov2-tiny.weights yolov2-tiny.conv.13 13

The .cfg file and initial weights can be found in ./yolo directory

darknet.exe detector train data\obj.data yolov2-tiny-hotdog.cfg yolov2-tiny.conv.13

3. Converting weights to TensorFlow protobuf (.pb)

The yolo weights is converted to TensorFlow model using darkflow:

flow --model ../yolov2-tiny-hotdog.cfg --load ../yolov2-tiny-hotdog_final.weights  --savepb

The saved .pb file can be found in ./yolo directory.

4. Quantization

The saved .pb is about 44MB. I used the quantization script in Tensorflow repo to quantize and reduced the size to 11MB.

python3 tensorflow/tools/quantization/quantize_graph.py --input=yolov2-tiny-hotdog.pb --output_node_names=output --output=quantized_yolov2-tiny-hotdog.pb --mode=weights

The quantized .pb file can be found in ./react-native-NotHotdog/ios/NotHotdog/data directory.

not-hotdog's People

Contributors

shaqian avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

not-hotdog's Issues

Not able to quantize a graph.

Hiii.
I'm not able to quantize a graph. There is no error occurred and no any warning and successfully run the command. But the problem is i can not locate a new quntized graph.

I have tried this command in terminal.
python python/quantize_graph.py --input=yolov2-tiny-ofg.pb --output_node_names=output --output=quantized_yolov2-tiny-ofg.pb --mode=weights

Hear is the code which is used https://github.com/tensorflow/tensorflow/tree/master/tensorflow/contrib/quantize

Thank you

No Android boxes + Making a NPM module out of it

Hi !

I just tried your app on my Android device and I noticed that there were no boxes around evaluated objects otherwise everything seems to work fine !

Have you considered to update it to use TensorFlow Lite ?

And I think you should definitely make a NPM module out of your implementation !

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.