visipedia / tf_classification

Training, evaluation and testing code for image classification using TensorFlow
MIT License
132 stars 35 forks source link

Add "extract_features.py" script. #6

Closed gvanhorn38 closed 7 years ago

gvanhorn38 commented 7 years ago

It would be convenient to have a script that allows you to extract features from images. For example the pre-logit features.

Could save the features in a numpy .npz file format, along with the ids of the regions.

gvanhorn38 commented 7 years ago

Check out extract.py

Example use:

python extract.py \
--tfrecords /Users/GVH/Desktop/cub_tfrecords/train/* \
--checkpoint_path /Users/GVH/Desktop/cub_train/finetune \
--save_path /Users/GVH/Desktop/cub_train/finetune/features.npz \
--config /Users/GVH/Desktop/cub_train/config_test.yaml \
--batch_size 8 \
--batches 10 \
--features PreLogits