2
0

coreml-converter 862 B

123456789101112131415161718192021222324252627282930313233
  1. #!/bin/bash
  2. set -e
  3. root=$(cd $(dirname ${0})/..; pwd)
  4. build=${root}/build
  5. tools=${root}/tools
  6. third_party=${root}/third_party
  7. python=${python:-python}
  8. pip=${pip:-pip}
  9. identifier=coremltools
  10. repository=https://github.com/apple/${identifier}.git
  11. mkdir -p ${third_party}
  12. if [ -d "${third_party}/${identifier}" ]; then
  13. git -C "${third_party}/${identifier}" fetch -p --quiet
  14. git -C "${third_party}/${identifier}" reset --quiet --hard origin/master
  15. else
  16. echo "Clone ${repository}..."
  17. git -C "${third_party}" clone --recursive ${repository}
  18. fi
  19. export PYTHONUSERBASE=${build}/third_party/pypi/${identifier}
  20. export PATH=$PATH:${PYTHONUSERBASE}/bin
  21. rm -rf ${PYTHONUSERBASE}
  22. ${pip} install --quiet --user onnx
  23. ${pip} install --quiet --user sklearn
  24. ${pip} install --quiet --user ${third_party}/${identifier}
  25. ${python} ${tools}/coreml-converter.py $@