| 123456789101112131415161718192021222324252627282930313233 |
- #!/bin/bash
- set -e
- root=$(cd $(dirname ${0})/..; pwd)
- build=${root}/build
- tools=${root}/tools
- third_party=${root}/third_party
- python=${python:-python}
- pip=${pip:-pip}
- identifier=coremltools
- repository=https://github.com/apple/${identifier}.git
- mkdir -p ${third_party}
- if [ -d "${third_party}/${identifier}" ]; then
- git -C "${third_party}/${identifier}" fetch -p --quiet
- git -C "${third_party}/${identifier}" reset --quiet --hard origin/master
- else
- echo "Clone ${repository}..."
- git -C "${third_party}" clone --recursive ${repository}
- fi
- export PYTHONUSERBASE=${build}/third_party/pypi/${identifier}
- export PATH=$PATH:${PYTHONUSERBASE}/bin
- rm -rf ${PYTHONUSERBASE}
- ${pip} install --quiet --user onnx
- ${pip} install --quiet --user sklearn
- ${pip} install --quiet --user ${third_party}/${identifier}
- ${python} ${tools}/coreml-converter.py $@
|