Enable testing of ImageNet and MNIST models from classify.py#2359
Enable testing of ImageNet and MNIST models from classify.py#2359dribnet wants to merge 2 commits intoBVLC:masterfrom
Conversation
Resurrected changes first introduced in b360e2a. This change enables testing the ImageNet Caffe model from classify.py as described in the current wiki pages: $ python python/classify.py --print_results examples/images/cat.jpg foo Loading file: examples/images/cat.jpg Classifying 1 inputs. Done in 1.43 s. [('tabby', '0.27353'), ('tiger cat', '0.23681'), ('Egyptian cat', '0.15175'), ('lynx', '0.12904'), ('kit fox', '0.04705')] Saving results into foo
Resurrected work done introduced f9cc18c and 961b00e. Here's an example invocation after this change: $ ./train_lenet.sh $ python python/classify.py --print_results \ --model_def examples/mnist/lenet.prototxt \ --pretrained_model examples/mnist/lenet_iter_10000.caffemodel \ --force_grayscale --center_only \ --labels_file data/mnist/mnist_words.txt \ --images_dim 28,28 data/mnist/sample_digit.png resultsfile Loading image file: data/mnist/sample_digit.png Classifying 1 inputs. Done in 0.05 s. [('Four', '1.00000'), ('Zero', '0.00000'), ('One', '0.00000'), ('Two', '0.00000'), ('Three', '0.00000')] Saving results into resultsfile
|
@dribnet I am getting an error |
|
@dribnet I got it. I used the files associated with this thread and replaced "scores" with "predictions". For reference: indices = (-predictions[0]).argsort()[:5] Thanks. |
|
Closing as |
| } | ||
| for l in f.readlines() | ||
| ]) | ||
| labels = labels_df.sort('synset_id')['name'].values |
There was a problem hiding this comment.
deprecated use of sort, now moved to sort_values.
~
http://pandas.pydata.org/pandas-docs/stable/generated/pandas.DataFrame.sort_values.html
This simply re-introduces changes originally added in #735 by @petewarden to the current version of caffe.
This enables testing the ImageNet Caffe model from classify.py as described in the current wiki pages:
and also adds MNIST support: