coreml-update 688 B

123456789101112131415161718192021222324
  1. #!/bin/bash
  2. set -e
  3. root=$(cd $(dirname ${0})/..; pwd)
  4. src=${root}/src
  5. tools=${root}/tools
  6. third_party=${root}/third_party
  7. identifier=coremltools
  8. repository=https://github.com/apple/${identifier}.git
  9. mkdir -p ${third_party}
  10. if [ -d "${third_party}/${identifier}" ]; then
  11. git -C "${third_party}/${identifier}" fetch -p
  12. git -C "${third_party}/${identifier}" reset --hard origin/master
  13. else
  14. echo "Clone ${repository}..."
  15. git -C "${third_party}" clone --recursive ${repository}
  16. fi
  17. echo "Generate '../src/coreml.js'"
  18. ${root}/node_modules/protobufjs/bin/pbjs -t static-module -w closure -r coreml -o ${src}/coreml.js ${third_party}/${identifier}/mlmodel/format/Model.proto