Skip to content

Latest commit

History

43 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

Compute-Features

Computes features for images using various pretrained Tensorflow models. For each model, this will output the final fully connected layer (e.g. fc7 for Alexnet, fc8 for VGG_19, etc.). These can be used within various applications such as classification, clustering, etc.

Usage

Download one of the checkpoint files below, for example Inception V1.

tar -xvf inception_v1_2016_08_28.tar.gz
python compute_features.py --data_dir=test_images/ --checkpoint_file=inception_v1.ckpt --model=inception_v1

The output will be in inception_v1_features.pkl, which contains a dictionary of the form {image_path:feature}.

Look at load_features.py for an example of how to use the features that were computed. For example,

python load_features.py features/inception_v1_features.pkl

Some of these aren't working, such as inception_v4 due to differences in the model checkpoint and the model defined in the nets/ directory. Still working on that.

Pre-trained Models

You can download all models here. Otherwise links for individual models can be found below.

These CNNs have been trained on the ILSVRC-2012-CLS image classification dataset.

In the table below, we list each model, the corresponding TensorFlow model file, the link to the model checkpoint, and the top 1 and top 5 accuracy (on the imagenet test set). Note that the VGG and ResNet V1 parameters have been converted from their original caffe formats (here and here), whereas the Inception and ResNet V2 parameters have been trained internally at Google. Also be aware that these accuracies were computed by evaluating using a single image crop. Some academic papers report higher accuracy by using multiple crops at multiple scales.

ModelTF-Slim FileCheckpointTop-1 AccuracyTop-5 Accuracy
Inception V1Codeinception_v1_2016_08_28.tar.gz69.889.6
Inception V2Codeinception_v2_2016_08_28.tar.gz73.991.8
Inception V3Codeinception_v3_2016_08_28.tar.gz78.093.9
Inception V4Codeinception_v4_2016_09_09.tar.gz80.295.2
Inception-ResNet-v2Codeinception_resnet_v2_2016_08_30.tar.gz80.495.3
ResNet V1 50Coderesnet_v1_50_2016_08_28.tar.gz75.292.2
ResNet V1 101Coderesnet_v1_101_2016_08_28.tar.gz76.492.9
ResNet V1 152Coderesnet_v1_152_2016_08_28.tar.gz76.893.2
ResNet V2 50Coderesnet_v2_50_2017_04_14.tar.gz75.692.8
ResNet V2 101Coderesnet_v2_101_2017_04_14.tar.gz77.093.7
ResNet V2 152Coderesnet_v2_152_2017_04_14.tar.gz77.894.1
VGG 16Codevgg_16_2016_08_28.tar.gz71.589.8
VGG 19Codevgg_19_2016_08_28.tar.gz71.189.8

About

Computes features for images using various pretrained Tensorflow models

Resources

Stars

311 stars

Watchers

14 watching

Forks

Releases

Packages

Contributors

Languages