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.
# 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
- Windows environment to use train.cmd
- Discrete GPU for faster training
- Note that you must install CuDNN and CUDA as described here
- 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)
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