Skip to content

recursionbane/tensorflow-prebuilt-classifier

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

tensorflow-prebuilt-classifier

A simple, pre-built classifier that can be programmed using image search terms, designed to run on Windows PCs.

This is designed for beginners, or for anyone wishing to harness simple neural networks to perform image classification on arbitrary categories.

Prerequisites

Required

  • NodeJS
  • Python3, recommended via Anaconda3
  • TensorFlow, install via Anaconda3 or pip:
# If you have a discrete GPU:
C:> pip install --ignore-installed --upgrade tensorflow-gpu
# If you are unsure, or you do not have a discrete GPU, use the CPU-only version (will take about 10x longer to run):
C:> pip install --ignore-installed --upgrade tensorflow

Optional

  • Windows environment to use train.cmd
  • Discrete GPU for faster training
  • Note that you must install CuDNN and CUDA as described here

Usage

  • Download/Clone all files in the repository
  • Edit train.cmd to specify your categories (e.g., 100 pictures of cars, bikes and trains):
node scrape2.js "cars" 100
node scrape2.js "bikes" 100
node scrape2.js "trains" 100
  • Launch train.cmd on the commandline (Win+R, type cmd, press enter); this can take up to an hour the first time:
C:> train.cmd
  • Supply an image (e.g., download.jpg) to test your newly retrained Neural Network image classifier:
C:> python predict.py download.jpg
...
cars (score = 0.69207)
trains (score = 0.16574)
bikes (score = 0.14219)

Possible use-cases

Here are some successful use-cases for this project, and the relevant categories specified in train.cmd:

  • Squirrel/no squirrel ("squirrel in garden", "garden"); prediction uses webcam image stream
  • Traffic/no traffic ("heavy traffic", "empty highway"); prediction uses public highway cam image stream
  • Type of package carrier ("usps truck", "ups truck", "fedex truck"); prediction uses webcam image stream

About

A simple, pre-built classifier that can morph to ANY image search term for categorization.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published