Giter VIP home page Giter VIP logo

caffe-pretrained-feature-extraction's Introduction

caffe-pretrained-feature-extraction

  • Go to directory
cd /path/to/caffe-pretrained-feature-extraction
  • Download the pre-trained weights of AlexNet
$CAFFE_ROOT/scripts/download_model_binary.py $CAFFE_ROOT/models/bvlc_alexnet
cp $CAFFE_ROOT/models/bvlc_alexnet/bvlc_alexnet.caffemodel ./alexnet.caffemodel
$CAFFE_ROOT/data/ilsvrc12/get_ilsvrc_aux.sh
cp $CAFFE_ROOT/data/ilsvrc12/imagenet_mean.binaryproto .
python convert_to_imagenet_mean_npy.py
  • Download the pre-trained weights of VGG(16 layers)
$CAFFE_ROOT/scripts/download_model_from_gist.sh 211839e770f7b538e2d8 $CAFFE_ROOT/models
cd $CAFFE_ROOT/models
mv 211839e770f7b538e2d8 VGG_ILSVRC_16_layers
cd VGG_ILSVRC_16_layers
wget http://www.robots.ox.ac.uk/~vgg/software/very_deep/caffe/VGG_ILSVRC_16_layers.caffemodel
cp VGG_ILSVRC_16_layers.caffemodel /path/to/caffe-pretrained-feature-extraction/vgg16.caffemodel
cd /path/to/caffe-pretrained-feature-extraction
  • Download the pre-trained weights of GoogLeNet
$CAFFE_ROOT/scripts/download_model_binary.py  $CAFFE_ROOT/models/bvlc_googlenet
cp $CAFFE_ROOT/models/bvlc_googlenet/bvlc_googlenet.caffemodel ./googlenet.caffemodel
  • Create train.txt, test.txt. The contents are like this:
cat train.txt
/path/to/trainimage0 1
/path/to/trainimage1 0
(...)
cat test.txt
/path/to/testimage0 0
/path/to/testimage1 0
(...)
  • Extract feature vectors from AlexNet(fc6), VGG(fc7, fc6), GoogLeNet(pool5/7x7_s1) and dump to hickle files
python example.py
python google_process_features.py
  • Train linear SVM, and report prediction on test data
python train_test_predict.py
cat alexnet_predict.txt
id,label
123,0
456,1
789,0
(...)

caffe-pretrained-feature-extraction's People

Contributors

norikinishida avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.