Giter Club home page Giter Club logo

hotdogdetector's Introduction

Final Result

Hot dog detector This is not technically a hot dog... but this network was trained on "sausage, hot dog, frankfurter" and is not too rigorous a model.

Steps towards reproducing results:

Data gathering

Run the download_multiple function inside of download_google_images.py. Example usage:

  download_multiple({"search_words": ["plane", "dog", "hot dog"],
                 "dir": "pictures",
                 "max_count": 1000,
                 "chrome_driver": "/usr/local/custom_bin/chromedriver",
                 "headless": True})

This will create the following directory:

  pictures/
      - dog/
      - plane/
      - /hot\ dog/

We are trying to train a binary classifier, so you need to condense the previous folders into 2 classes: my 2 classes are "hot dog" and "not hot dog" I am using tensorflow ImageDataGenerator() to create datasets ingestible by a CNN, to get data in this form, we need our folder structure to look like:

  data/
      - train/
          - hot\ dog/
          - not\ hot\ dog/
      - val/
          - hot\ dog/
          - not\ hot\ dog/
      - test/
          - hot\ dog/
          - not\ hot\ dog/

Inside of data_prep.py, create_batches will achieve this. Now, from main.py, we will reference this data folder to actually train our CNN. Running this file will create .h5 models at every epoch. You can test this model using pred.py.

Now we must use convert.py to convert it to an .mlmodel, which is the format iOS uses.

ViewController.swift has the necessary swift code for model inference using the native camera. Make sure to add the camera privacy description in your info.plist

hotdogdetector's People

Contributors

rickyavina avatar

Watchers

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