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() {
|
2022-12-07 05:51:04 +00:00
|
|
|
if [[ -z "$MODEL_PATH" && ! -z "$1" ]]; then
|
2022-12-07 05:32:14 +00:00
|
|
|
export MODEL_PATH="$1"
|
|
|
|
fi
|
|
|
|
|
2022-12-07 05:51:04 +00:00
|
|
|
if [[ -z "$DATA_FOLDER" && ! -z "$2" ]]; then
|
2022-12-07 05:32:14 +00:00
|
|
|
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
|