Skip to content

Commit

Permalink
document power_wrapper -> detector in detection notebook
Browse files Browse the repository at this point in the history
  • Loading branch information
shelhamer committed Jan 26, 2014
1 parent fb062d4 commit 6408ac1
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions python/caffe/detection/selective_search_demo.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -11,22 +11,21 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"This approach follows ideas described in Ross Girshick, Jeff Donahue, Trevor Darrell, Jitendra Malik. *Rich feature hierarchies for accurate object detection and semantic segmentation*. [Arxiv 2013](http://arxiv.org/abs/1311.2524).\n",
"\n",
"First of all, we'll need a little [Python script](https://github.com/sergeyk/selective_search_ijcv_with_python) to run the Matlab Selective Search code.\n",
"\n",
"Let's run detection on an image of a couple of cats frolicking (one of the ImageNet detection challenge pictures), which we will download from the web.\n",
"You'll need a prototxt specifying the network, and a trained model.\n",
"We will use `examples/imagenet_deploy.prototxt` and `models/alexnet_train_iter_470000`: you'll need to download the latter for yourself!\n",
"Let's run detection on an image of a couple of cats frolicking (one of the ImageNet detection challenge pictures), which we will download from the web. You'll need a prototxt specifying the network, and a trained model. We will use `examples/imagenet_deploy.prototxt` and `alexnet_train_iter_470000` or [caffe_reference_imagenet_model](https://www.dropbox.com/s/n3jups0gr7uj0dv/caffe_reference_imagenet_model): you'll need to download the model for yourself! Note that `caffe_reference_imagenet_model` may give slightly different results than this example, which uses `alexnet_train_iter_470000`.\n",
"\n",
" wget http://farm1.static.flickr.com/220/512450093_7717fb8ce8.jpg\n",
" echo `pwd`/\"512450093_7717fb8ce8.jpg\" > image_cat.txt\n",
" python detector.py --images_file=image_cat.txt --crop_mode=selective_search --model_def=<path to imagenet_deploy.prototxt> --pretrained_model=<path to alexnet_train_iter_470000> --output=selective_cat.h5\n",
" \n",
" \n",
"Running this outputs an HDF5 file with the filenames, selected windows, and their ImageNet scores.\n",
"Of course, we only ran on one image, so the filenames will all be the same.\n",
" python detector.py --images_file=image_cat.txt --crop_mode=selective_search --model_def=<path to imagenet_deploy.prototxt> --pretrained_model=<path to alexnet_train_iter_470000> --output_file=selective_cat.h5\n",
"\n",
"Running this outputs an HDF5 file with the filenames, selected windows, and their ImageNet scores. Of course, we only ran on one image, so the filenames will all be the same.\n",
"\n",
"In general, `detector` is most efficient when running on a lot of images: it first extracts window proposals for all of them, batches the windows for efficient GPU processing, and then outputs the results. Simply list an image per line in the `images_file`, and `detector` will process all of them.\n",
"\n",
"In general, `detector` is most efficient when running on a lot of images: it first extracts window proposals for all of them, then batches the windows for efficient GPU processing, and then outputs the results.\n",
"Simply list an image per line in the `images_file`, and `detector` will process all of them."
"Although this guide gives an example of ImageNet detection, `detector` is clever enough to adapt to different Caffe models\u2019 input dimensions, batch size, and output categories. Refer to `python detector.py --help` and the `images_dim` and `images_mean_file` parameters to describe your data set. No need for hardcoding."
]
},
{
Expand Down

0 comments on commit 6408ac1

Please sign in to comment.