From d124b8ffe8b9680fa4e0339a0a698622472a0610 Mon Sep 17 00:00:00 2001 From: Evan Shelhamer Date: Tue, 18 Mar 2014 13:54:17 -0700 Subject: [PATCH] drop models/ in favor of examples/ Move the Caffe reference imagenet model and script to fetch it to examples/imagenet. Caffe bundles reference models, but it makes more sense to keep them close to examples. --- docs/getting_pretrained_models.md | 2 +- docs/imagenet_training.md | 2 +- examples/filter_visualization.ipynb | 6 +++--- {models => examples/imagenet}/get_caffe_reference_imagenet_model.sh | 0 .../imagenet.prototxt => examples/imagenet/imagenet_deploy.prototxt | 0 examples/selective_search_demo.ipynb | 4 ++-- matlab/caffe/matcaffe_demo.m | 4 ++-- models/.gitignore | 0 python/caffe/detection/detector.py | 4 ++-- 9 files changed, 11 insertions(+), 11 deletions(-) rename {models => examples/imagenet}/get_caffe_reference_imagenet_model.sh (100%) rename models/imagenet.prototxt => examples/imagenet/imagenet_deploy.prototxt (100%) delete mode 100644 models/.gitignore diff --git a/docs/getting_pretrained_models.md b/docs/getting_pretrained_models.md index fb10812..56a6445 100644 --- a/docs/getting_pretrained_models.md +++ b/docs/getting_pretrained_models.md @@ -12,6 +12,6 @@ This page will be updated as more models become available. ### ImageNet -Our reference implementation of the AlexNet model trained on ILSVRC-2012 can be downloaded (232.57MB) by running `models/get_caffe_reference_imagenet_model.sh` from the Caffe root directory. +Our reference implementation of the AlexNet model trained on ILSVRC-2012 can be downloaded (232.57MB) by running `examples/imagenet/get_caffe_reference_imagenet_model.sh` from the Caffe root directory. Additionally, you will probably eventually need some auxiliary data (mean image, synset list, etc.): run `data/ilsvrc12/get_ilsvrc_aux.sh` from the root directory to obtain it. diff --git a/docs/imagenet_training.md b/docs/imagenet_training.md index 140ee68..a1553dd 100644 --- a/docs/imagenet_training.md +++ b/docs/imagenet_training.md @@ -52,7 +52,7 @@ which will make `data/ilsvrc12/imagenet_mean.binaryproto`. Network Definition ------------------ -The network definition follows strictly the one in Krizhevsky et al. You can find the detailed definition at `examples/imagenet/imagenet.prototxt`. Note that the paths in the data layer - if you have not followed the exact paths in this guide you will need to change the following lines: +The network definition follows strictly the one in Krizhevsky et al. You can find the detailed definition at `examples/imagenet/imagenet_train.prototxt`. Note the paths in the data layer - if you have not followed the exact paths in this guide you will need to change the following lines: source: "ilvsrc12_train_leveldb" meanfile: "../../data/ilsvrc12/imagenet_mean.binaryproto" diff --git a/examples/filter_visualization.ipynb b/examples/filter_visualization.ipynb index 30cf8b7..881f44b 100644 --- a/examples/filter_visualization.ipynb +++ b/examples/filter_visualization.ipynb @@ -59,8 +59,8 @@ "cell_type": "code", "collapsed": false, "input": [ - "net = caffe.imagenet.ImageNetClassifier(caffe_root + 'models/imagenet.prototxt',\n", - " caffe_root + 'models/caffe_reference_imagenet_model')\n", + "net = caffe.imagenet.ImageNetClassifier(caffe_root + 'examples/imagenet/imagenet_deploy.prototxt',\n", + " caffe_root + 'examples/imagenet/caffe_reference_imagenet_model')\n", "net.caffenet.set_phase_test()\n", "net.caffenet.set_mode_cpu()" ], @@ -615,4 +615,4 @@ "metadata": {} } ] -} \ No newline at end of file +} diff --git a/models/get_caffe_reference_imagenet_model.sh b/examples/imagenet/get_caffe_reference_imagenet_model.sh similarity index 100% rename from models/get_caffe_reference_imagenet_model.sh rename to examples/imagenet/get_caffe_reference_imagenet_model.sh diff --git a/models/imagenet.prototxt b/examples/imagenet/imagenet_deploy.prototxt similarity index 100% rename from models/imagenet.prototxt rename to examples/imagenet/imagenet_deploy.prototxt diff --git a/examples/selective_search_demo.ipynb b/examples/selective_search_demo.ipynb index 1e0d1d9..6891a9e 100644 --- a/examples/selective_search_demo.ipynb +++ b/examples/selective_search_demo.ipynb @@ -27,7 +27,7 @@ "!mkdir _temp\n", "!curl http://farm1.static.flickr.com/220/512450093_7717fb8ce8.jpg > _temp/cat.jpg\n", "!echo `pwd`/_temp/cat.jpg > _temp/cat.txt\n", - "!python ../python/caffe/detection/detector.py --crop_mode=selective_search --pretrained_model=../models/caffe_reference_imagenet_model --model_def=../models/imagenet.prototxt _temp/cat.txt _temp/cat.h5" + "!python ../python/caffe/detection/detector.py --crop_mode=selective_search --pretrained_model=../examples/imagenet/caffe_reference_imagenet_model --model_def=../examples/imagenet/imagenet_deploy.prototxt _temp/cat.txt _temp/cat.h5" ], "language": "python", "metadata": {}, @@ -692,4 +692,4 @@ "metadata": {} } ] -} \ No newline at end of file +} diff --git a/matlab/caffe/matcaffe_demo.m b/matlab/caffe/matcaffe_demo.m index 459fef9..c034172 100644 --- a/matlab/caffe/matcaffe_demo.m +++ b/matlab/caffe/matcaffe_demo.m @@ -20,9 +20,9 @@ function scores = matcaffe_demo(im, use_gpu) % scores = matcaffe_demo(im, 1); % [score, class] = max(scores); -model_def_file = '../../models/imagenet.prototxt'; +model_def_file = '../../examples/imagenet/imagenet_deploy.prototxt'; % NOTE: you'll have to get the pre-trained ILSVRC network -model_file = '../../models/caffe_reference_imagenet_model'; +model_file = '../../examples/imagenet/caffe_reference_imagenet_model'; % init caffe network (spews logging info) caffe('init', model_def_file, model_file); diff --git a/models/.gitignore b/models/.gitignore deleted file mode 100644 index e69de29..0000000 diff --git a/python/caffe/detection/detector.py b/python/caffe/detection/detector.py index dd9b527..9355274 100644 --- a/python/caffe/detection/detector.py +++ b/python/caffe/detection/detector.py @@ -371,12 +371,12 @@ if __name__ == "__main__": # Optional arguments. parser.add_argument( "--model_def", - default="../../../models/imagenet.prototxt", + default="../../../examples/imagenet/imagenet_deploy.prototxt", help="Model definition file." ) parser.add_argument( "--pretrained_model", - default="../../../models/caffe_reference_imagenet_model", + default="../../../examples/imagenet/caffe_reference_imagenet_model", help="Trained model weights file." ) parser.add_argument( -- 2.7.4