diff options
author | Sergey Karayev <sergeykarayev@gmail.com> | 2014-09-04 01:13:29 +0100 |
---|---|---|
committer | Sergey Karayev <sergeykarayev@gmail.com> | 2014-09-04 03:59:14 +0100 |
commit | d5e9739e5261de5f30832c06d849da5265bc95c6 (patch) | |
tree | d48ed60ba215ea7eca1f434f9c2c5da86d741ff8 /examples | |
parent | a66100181be17f843bac411cf52ff24aeace6306 (diff) | |
download | caffeonacl-d5e9739e5261de5f30832c06d849da5265bc95c6.tar.gz caffeonacl-d5e9739e5261de5f30832c06d849da5265bc95c6.tar.bz2 caffeonacl-d5e9739e5261de5f30832c06d849da5265bc95c6.zip |
updating feature extraction example
Diffstat (limited to 'examples')
-rw-r--r-- | examples/feature_extraction/imagenet_val.prototxt | 4 | ||||
-rw-r--r-- | examples/feature_extraction/readme.md | 10 |
2 files changed, 7 insertions, 7 deletions
diff --git a/examples/feature_extraction/imagenet_val.prototxt b/examples/feature_extraction/imagenet_val.prototxt index 32310904..83fe8c1a 100644 --- a/examples/feature_extraction/imagenet_val.prototxt +++ b/examples/feature_extraction/imagenet_val.prototxt @@ -5,14 +5,14 @@ layers { top: "data" top: "label" image_data_param { - source: "$CAFFE_DIR/examples/_temp/file_list.txt" + source: "examples/_temp/file_list.txt" batch_size: 50 new_height: 256 new_width: 256 } transform_param { crop_size: 227 - mean_file: "$CAFFE_DIR/data/ilsvrc12/imagenet_mean.binaryproto" + mean_file: "data/ilsvrc12/imagenet_mean.binaryproto" mirror: false } } diff --git a/examples/feature_extraction/readme.md b/examples/feature_extraction/readme.md index 083908eb..c325ed48 100644 --- a/examples/feature_extraction/readme.md +++ b/examples/feature_extraction/readme.md @@ -10,7 +10,9 @@ Extracting Features =================== In this tutorial, we will extract features using a pre-trained model with the included C++ utility. -Follow instructions for [installing Caffe](../../installation.html) and for [downloading the reference model](../../getting_pretrained_models.html) for ImageNet. +Note that we recommend using the Python interface for this task, as for example in the [filter visualization example](http://nbviewer.ipython.org/github/BVLC/caffe/blob/master/examples/filter_visualization.ipynb). + +Follow instructions for [installing Caffe](../../installation.html) and run `scripts/download_model_binary.py models/bvlc_reference_caffenet` from caffe root directory. If you need detailed information about the tools below, please consult their source code, in which additional documentation is usually provided. Select data to run on @@ -35,7 +37,7 @@ Define the Feature Extraction Network Architecture In practice, subtracting the mean image from a dataset significantly improves classification accuracies. Download the mean image of the ILSVRC dataset. - data/ilsvrc12/get_ilsvrc_aux.sh + ./data/ilsvrc12/get_ilsvrc_aux.sh We will use `data/ilsvrc212/imagenet_mean.binaryproto` in the network definition prototxt. @@ -44,14 +46,12 @@ We'll be using the `ImageDataLayer`, which will load and resize images for us. cp examples/feature_extraction/imagenet_val.prototxt examples/_temp -Edit `examples/_temp/imagenet_val.prototxt` to use correct path for your setup (replace `$CAFFE_DIR`) - Extract Features ---------------- Now everything necessary is in place. - build/tools/extract_features.bin examples/imagenet/caffe_reference_imagenet_model examples/_temp/imagenet_val.prototxt fc7 examples/_temp/features 10 + ./build/tools/extract_features.bin models/bvlc_reference_caffenet/bvlc_reference_caffenet.caffemodel examples/_temp/imagenet_val.prototxt fc7 examples/_temp/features 10 The name of feature blob that you extract is `fc7`, which represents the highest level feature of the reference model. We can use any other layer, as well, such as `conv5` or `pool3`. |