8000 Stop-gap fixes for pycaffe by shelhamer · Pull Request #1902 · BVLC/caffe · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Stop-gap fixes for pycaffe #1902

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Feb 19, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions examples/classification.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"example_name": "ImageNet classification",
"include_in_docs": true,
"priority": 1,
"signature": "sha256:2caae2c1fe3e282b8f836d380a45622351c91db18a1591e4f2fa67faba9ab72c"
"signature": "sha256:918b797b1b7d78125c8f1e3c84756b0679120cbe1071ce7fee7aeafef0fbae55"
},
"nbformat": 3,
"nbformat_minor": 0,
Expand Down Expand Up @@ -64,10 +64,9 @@
"cell_type": "code",
"collapsed": false,
"input": [
"caffe.set_phase_test()\n",
"caffe.set_mode_cpu()\n",
"net = caffe.Classifier(MODEL_FILE, PRETRAINED,\n",
" mean=np.load(caffe_root + 'python/caffe/imagenet/ilsvrc_2012_mean.npy'),\n",
" mean=np.load(caffe_root + 'python/caffe/imagenet/ilsvrc_2012_mean.npy').mean(1).mean(1),\n",
" channel_swap=(2,1,0),\n",
" raw_scale=255,\n",
" image_dims=(256, 256))"
Expand Down Expand Up @@ -237,7 +236,7 @@
"# Resize the image to the standard (256, 256) and oversample net input sized crops.\n",
"input_oversampled = caffe.io.oversample([caffe.io.resize_image(input_image, net.image_dims)], net.crop_dims)\n",
"# 'data' is the input blob name in the model definition, so we preprocess for that input.\n",
"caffe_input = np.asarray([net.preprocess('data', in_) for in_ in input_oversampled])\n",
"caffe_input = np.asarray([net.transformer.preprocess('data', in_) for in_ in input_oversampled])\n",
"# forward() takes keyword args for the input blobs with preprocessed input arrays.\n",
"%timeit net.forward(data=caffe_input)"
],
Expand Down
Loading
0