Giter Club home page Giter Club logo

dog-project's Introduction

Convolutional Neural Networks

Convolutional Neural Networks (CNN) project developed for Udacity's Deep Learning Nanodegree. The goal of this project is to build a pipeline that can be used within a web or mobile app to process real-world, user-supplied images. Given an image of a dog, the app will provide an estimate of the canine’s breed. If supplied an image of a human, the app will identify the resembling dog breed.

Getting Started

Setup Environment

Clone the Repository

git clone https://github.com/geoglyph/dog-project.git
cd dog-project

Setup Linux

Tested on the following environment:

  • Ubuntu 16.04.4 LTS
  • NVIDIA GTX1080 (driver version 384.130)
  • CUDA® Toolkit 9.0
  • cuDNN v7.0

Create a Linux Conda environment with CPU backend and upgrade tensorflow:

conda env create -f requirements/dog-linux.yml
conda activate dog-project
pip install flask gevent requests pillow
pip install --ignore-installed --upgrade https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-1.8.0-cp36-cp36m-linux_x86_64.whl
KERAS_BACKEND=tensorflow python -c "from keras import backend"
python -m ipykernel install --user --name dog-project --display-name "dog-project"

Create a Linux Conda environment with GPU backend and upgrade tensorflow:

conda env create -f requirements/dog-linux-gpu.yml
conda activate dog-project
pip install flask gevent requests pillow
pip install --ignore-installed --upgrade https://storage.googleapis.com/tensorflow/linux/gpu/tensorflow_gpu-1.8.0-cp36-cp36m-linux_x86_64.whl
KERAS_BACKEND=tensorflow python -c "from keras import backend"
python -m ipykernel install --user --name dog-project --display-name "dog-project"

Setup Windows

Tested on the following environment:

  • Windows 10 Pro, 64-bit
  • NVIDIA GTX1080 (driver version 385.54)
  • CUDA® Toolkit 9.0
  • cuDNN v7.0

Create a Windows Conda environment with CPU backend and upgrade tensorflow:

conda env create -f requirements/dog-windows.yml
conda activate dog-project
pip install flask gevent requests pillow
pip install --ignore-installed --upgrade tensorflow
set KERAS_BACKEND=tensorflow
python -c "from keras import backend"
python -m ipykernel install --user --name dog-project --display-name "dog-project"

Create a Windows Conda environment with GPU backend and upgrade tensorflow:

conda env create -f requirements/dog-windows-gpu.yml
conda activate dog-project
pip install flask gevent requests pillow
pip install --ignore-installed --upgrade tensorflow-gpu
set KERAS_BACKEND=tensorflow
python -c "from keras import backend"
python -m ipykernel install --user --name dog-project --display-name "dog-project"

Download Supporting Files

Datasets

Download the following datasets and copy to dog-project/dogImages and dog-project/lfw respectively.

dog dataset

human dataset

Pre-computed Bottleneck Features

Download the following pre-computed bottleneck features and copy to `dog-project/bottleneck_features.

VGG-16 bottleneck features

Inception bottleneck features

Jupyter Notebooks

The following jupyter notebooks were developed to support this project:

Description Link
Project notebook provided by Udacity, demonstrates transfer learning with Keras Dog App Notebook
Demonstrates the use of data augmentation with transfer learning with Keras Dog App Augmented Notebook

Python Programs

The following python programs were developed to support this project:

Description File
Runs inference on each file in /images folder using saved InceptionV3 model predict_breed.py
Use flask to host simple REST API providing inference on saved InceptionV3 model predict_breed_server.py
Used to test REST API, sends each file in /images folder to REST API for inference server_api_test.py

References

The following resources were used in developing this project:

Usage Link
Python code used to visualise loss history when training a Keras model Visualize Loss History
Keras data augmentation example
refer: cifar10-augmentation/cifar10_augmentation.ipynb
Used in development of data augmentation code in Jupyter notebooks
AIND Term 2 -- Lesson on Convolutional Neural Networks
Keras bottleneck feature extraction
refer: transfer-learning/bottleneck_features.ipynb
Used in development of feature extraction code in Jupyter notebooks
AIND Term 2 -- Lesson on Convolutional Neural Networks
Keras bottleneck feature extraction with data augmentation
Used as initial inspiration for Dog App Augmented
The Keras Blog
Deploying a Keras model as a REST API
Used as initial inspiration for predict_breed_server.py
The Keras Blog

dog-project's People

Contributors

craig-martinson avatar geoglyph 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.