DEEP OC dogs breed determination

By DEEP-Hybrid-DataCloud Consortium | Created: - Updated:

models/toy, services/toy, library/tensorflow, docker

License: Apache License 2.0

Build Status

A toy example to identify Dog's breed, "Dogs breed detector", as example for DEEPaaS API.

Dogs breed detector is originally forked from udacity/dogs-project, dataset comes from dog dataset.

The project applies Transfer learning for dog's breed identification, implemented with Tensorflow and Keras:

From a pre-trained model (VGG16 | VGG19 | Resnet50 | InceptionV3 | Xception) the last layer is removed, then a new FC classification layer is added, which is trained. All images first pass through the pre-trained network and converted into the tensor with the shape of the 'before-last' layer of the pre-trained network, into so-called 'bottleneck_features'. These bottleneck_features are used then as input for the FC classification network.

Run locally on your computer

Using Docker

You can run this model directly on your computer, assuming that you have Docker installed, by following these steps:

$ docker pull deephdc/deep-oc-dogs_breed_det
$ docker run -ti -p 5000:5000 deephdc/deep-oc-dogs_breed_det

Using udocker

If you do not have Docker available or you do not want to install it, you can use udocker within a Python virtualenv:

$ virtualenv udocker
$ source udocker/bin/activate
$ git clone https://github.com/indigo-dc/udocker
$ cd udocker
$ pip install .
$ udocker pull deephdc/deep-oc-dogs_breed_det
$ udocker create deephdc/deep-oc-dogs_breed_det
$ udocker run -p 5000:5000  deephdc/deep-oc-dogs_breed_det

Once running, point your browser to http://127.0.0.1:5000/ and you will see the API documentation, where you can test the model functionality, as well as perform other actions (such as training).

For more information, refer to the user documentation.

Run on our pilot e-Infrastructure

In order to execute this model in our pilot e-Infrastructure you would need to be registered in the DEEP IAM.
The following instructions make use of the orchent CLI. You would need to install and configure orchent as shown in this tutorial.

Mesos (GPU)

$ curl -o deep-oc-dogs-breed-determination.yml \
    https://raw.githubusercontent.com/indigo-dc/tosca-templates/master/deep-oc/deep-oc-dogs_breed-mesos-gpu.yml
$ orchent deep-oc-dogs-breed-determination.yml  '{"rclone_conf"="...", "rclone_url"="...", "rclone_vendor"="...", "rclone_user"="...", "rclone_pass"="..."}'

Mesos (CPU)

$ curl -o deep-oc-dogs-breed-determination.yml \
    https://raw.githubusercontent.com/indigo-dc/tosca-templates/master/deep-oc/deep-oc-dogs_breed-mesos-cpu.yml
$ orchent deep-oc-dogs-breed-determination.yml  '{"rclone_conf"="...", "rclone_url"="...", "rclone_vendor"="...", "rclone_user"="...", "rclone_pass"="..."}'

Check the status of your job

$ orchent depshow <Deployment UUID>

Once its state is CREATE_COMPLETE, you will get the endpoint to access the service, e.g:

"endpoint": "mesos-lb.recas.ba.infn.it:10002"
Point your browser to the provided URL.

For more information, refer to the user documentation.