Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
shell script to run classification with trained caffe model
#!/bin/bash
if [[ $# < 1 ]]; then
INPUT=test.jpg;
else
INPUT=$1
fi
PRETRAINED_DIR=/home/cc/jxshi/code/plankton/remark/spp/release_0.86
MEAN_FILE=/home/cc/jxshi/data/plankton/size_96_aug_6/plankton_train_mean.npy
ITER=50000
echo "testing $INPUT with $PRETRAINED_DIR"
python scripts/classify.py \
--model_def $PRETRAINED_DIR/proto/deploy.prototxt \
--pretrained_model $PRETRAINED_DIR/lenet_snapshot_iter_$ITER.caffemodel \
--images_dim '96,96' \
--gpu \
--mean_file $MEAN_FILE \
--input_scale 0.00390625 \
--channel_swap '0' \
$INPUT test.out >> test.log 2>&1
echo ""
echo "tail test.log"
tail test.log
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment