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

Watchers

James Cloos avatar Jeffrey Detras 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.