2022-12-04 09:00:34 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
2022-12-04 09:33:06 +00:00
|
|
|
set -e
|
|
|
|
|
2022-12-07 05:32:14 +00:00
|
|
|
function populate_env() {
|
|
|
|
if [[ -z "$MODEL_PATH" ] && [ ! -z "$1" ]]; then
|
|
|
|
export MODEL_PATH="$1"
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [[ -z "$DATA_FOLDER" ] && [ ! -z "$2" ]]; then
|
|
|
|
export DATA_FOLDER="$2"
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
populate_env
|
|
|
|
|
|
|
|
case "$1" in
|
|
|
|
train)
|
|
|
|
precise-lite-train $TRAIN_ARGS "$MODEL_PATH" "$DATA_FOLDER"
|
|
|
|
;;
|
|
|
|
"train-incremental")
|
|
|
|
precise-lite-train-incremental $TRAIN_ARGS "$MODEL_PATH" "$DATA_FOLDER"
|
|
|
|
;;
|
|
|
|
test)
|
|
|
|
precise-lite-test "$MODEL_PATH" "$DATA_FOLDER"
|
|
|
|
;;
|
|
|
|
convert)
|
|
|
|
precise-lite-convert "$MODEL_PATH"
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
exec $@
|
|
|
|
;;
|
|
|
|
esac
|