Skip to content

Classification

ProGamerGov edited this page May 17, 2017 · 3 revisions

Figuring Out What The Model Sees In The Image:


First make sure you are in the Protobuf-Dreamer directory:

cd ~

cd Protobuf-Dreamer

Then navigate to the model directory which was created during the setup process:

cd model

Now download the "unstripped" version of the model and extract it:

wget http://download.tensorflow.org/models/image/imagenet/inception-2015-12-05.tgz

tar -xvzf inception-2015-12-05.tgz

Next, download this script and place it into your Protobuf-Dreamer directory:

https://gist.github.com/ProGamerGov/da00b890ffacd0475f1ce013e988a549

The script only takes .jpg images, so you may have to first convert your image the the jpeg format.

The script has 3 parameters:

  • --num_top_predictions: Displays a specified number of predictions. Default: 5

  • --image_file: The path to your image file that you want to classify.

  • --model_dir: The path to the .pb model file, human label mapping text file, and the proto label text file.

Example Usage:

python classify_image.py --model_dir /home/ubuntu/Protobuf-Dreamer/model/ --image_file mixed4c_3x3_bottleneck_channel_41.png

The test image used

The output of the script will look something like this:

spider web, spider's web (score = 0.20058)
peacock (score = 0.05310)
confectionery, confectionary, candy store (score = 0.02536)
coil, spiral, volute, whorl, helix (score = 0.02438)
brain coral (score = 0.02346)

Clone this wiki locally