Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:15:48

0001 #!/bin/bash
0002 
0003 # borrowed from https://github.com/triton-inference-server/server/tree/master/docs/examples
0004 
0005 TRITON_REPO="https://github.com/triton-inference-server/server"
0006 TRITON_VERSION=$(scram tool info triton-inference-client | grep "Version : " | cut -d' ' -f3 | cut -d'-' -f1)
0007 
0008 TEST_DIR=`pwd`
0009 
0010 get_model(){
0011         MODEL_NAME="$1"
0012 
0013         MODEL_DIR=${TEST_DIR}/../data/models/${MODEL_NAME}
0014         cd $TEST_DIR
0015         mkdir -p $MODEL_DIR
0016         cd $MODEL_DIR
0017 
0018         if [[ "$MODEL_NAME" == inception_graphdef ]]; then
0019                 FNAME=inception_v3_2016_08_28_frozen.pb.tar.gz
0020                 mkdir -p 1
0021                 mkdir -p tmp
0022                 wget -O tmp/${FNAME} https://storage.googleapis.com/download.tensorflow.org/models/${FNAME}
0023                 (cd tmp && tar -xzf ${FNAME})
0024                 mv tmp/inception_v3_2016_08_28_frozen.pb 1/model.graphdef
0025                 rm -rf tmp
0026         elif [[ "$MODEL_NAME" == densenet_onnx ]]; then
0027                 mkdir -p 1
0028                 wget -O 1/model.onnx https://contentmamluswest001.blob.core.windows.net/content/14b2744cf8d6418c87ffddc3f3127242/9502630827244d60a1214f250e3bbca7/08aed7327d694b8dbaee2c97b8d0fcba/densenet121-1.2.onnx
0029         fi
0030 
0031         curl -O -L ${TRITON_REPO}/raw/v${TRITON_VERSION}/docs/examples/model_repository/${MODEL_NAME}/config.pbtxt
0032         curl -O -L ${TRITON_REPO}/raw/v${TRITON_VERSION}/docs/examples/model_repository/${MODEL_NAME}/$(echo $MODEL_NAME | cut -d'_' -f1)_labels.txt
0033 }
0034 
0035 get_model inception_graphdef
0036 get_model densenet_onnx