prepare.sh 1.7 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48
#!/bin/bash
source test_tipc/common_func.sh

FILENAME=$1
MODE=$2

# MODE be one of ['lite_train_lite_infer','lite_train_whole_infer' 
#                  'whole_train_whole_infer', 'whole_infer']          

dataline=$(cat ${FILENAME})

# parser params
IFS=$'\n'
lines=(${dataline})

# The training params
model_name=$(func_parser_value "${lines[1]}")

trainer_list=$(func_parser_value "${lines[12]}")


if [ ${MODE} = "lite_train_lite_infer" ];then
    # prepare lite data
    tar -xf ./test_images/lite_data.tar
    ln -s ./lite_data/ ./data
    if [[ ${model_name} == "mobilenet_v3_small" ]];then
        wget -nc -P  ./pretrain_models/ https://paddle-model-ecology.bj.bcebos.com/model/mobilenetv3_reprod/mobilenet_v3_small_pretrained.pdparams  --no-check-certificate
    fi

elif [ ${MODE} = "whole_train_whole_infer" ];then
    tar -xf ../test_images/lite_data.tar
    # prepare whole data
    if [[ ${model_name} == "mobilenet_v3_small" ]];then
        wget -nc -P  ./pretrain_models/ https://paddle-model-ecology.bj.bcebos.com/model/mobilenetv3_reprod/mobilenet_v3_small_pretrained.pdparams  --no-check-certificate
    fi
    
elif [ ${MODE} = "lite_train_whole_infer" ];then
    tar -xf ../test_images/lite_data.tar
    if [[ ${model_name} == "mobilenet_v3_small" ]];then
        wget -nc -P  ./pretrain_models/ https://paddle-model-ecology.bj.bcebos.com/model/mobilenetv3_reprod/mobilenet_v3_small_pretrained.pdparams  --no-check-certificate
    fi

elif [ ${MODE} = "whole_infer" ];then
    tar -xf ../test_images/lite_data.tar
    if [[ ${model_name} == "mobilenet_v3_small" ]];then
        wget -nc -P  ./pretrain_models/ https://paddle-model-ecology.bj.bcebos.com/model/mobilenetv3_reprod/mobilenet_v3_small_pretrained.pdparams  --no-check-certificate
    fi
fi