https://github.com/elucidation/tensorflow-cat-dog-classifier
Tutorial on using Tensorflow to train a cat/dog classifier, as well as building your own dataset to train on
https://github.com/elucidation/tensorflow-cat-dog-classifier
Last synced: about 1 year ago
JSON representation
Tutorial on using Tensorflow to train a cat/dog classifier, as well as building your own dataset to train on
- Host: GitHub
- URL: https://github.com/elucidation/tensorflow-cat-dog-classifier
- Owner: Elucidation
- License: mit
- Created: 2017-01-30T01:00:48.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2024-01-07T00:34:04.000Z (over 2 years ago)
- Last Synced: 2025-02-10T00:17:00.525Z (over 1 year ago)
- Language: Jupyter Notebook
- Size: 25 MB
- Stars: 2
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Tensorflow Cats vs Dogs classifier
---
# Ipython notebook new Mobilenet model
Using TF Keras to transfer learn + fine-tune a MobileNetV2 model on our own dataset of dogs/cats.
We get around 93% accuracy on the test dataset.
[Ipython notebook training testing model](dogcat.ipynb)

# Old model
We build our own dataset from existing flicker images of cats and dogs, and then train a tensorflow neural network to classify cats and dogs.
Run using `./cats_vs_dogs.py`
Currently a single layer NN, no successful learning yet
```
usage: cats_vs_dogs.py [-h] [--cat_dir CAT_DIR] [--dog_dir DOG_DIR]
[--num_steps NUM_STEPS]
optional arguments:
-h, --help show this help message and exit
--cat_dir CAT_DIR Directory for storing input cat images
--dog_dir DOG_DIR Directory for storing input dog images
--num_steps NUM_STEPS
Number of steps to train model
```
# Building a dataset
`resize_images.py` contains a script to resize all passed in images into
64x64 grayscale pngs named `####.png` monotonically increasing in the
specified output folder
```
Usage: resize_images.py [options] image1 [image2 ...]
Options:
-h, --help show this help message and exit
-o OUTPUT_FOLDER, --output_folder=OUTPUT_FOLDER
Output folder to save resized images to
-n MAX_N, --max_number=MAX_N
Maximum number of images to process
-d, --dryrun Do a dry run (no processing/saving)
```