tflite-update 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  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. mkdir -p ${third_party}
  8. identifier=flatbuffers
  9. repository=https://github.com/google/${identifier}.git
  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. pushd "${third_party}/${identifier}" > /dev/null
  18. cmake -G "Unix Makefiles"
  19. make
  20. popd > /dev/null
  21. identifier=tensorflow
  22. repository=https://github.com/tensorflow/${identifier}.git
  23. if [ -d "${third_party}/${identifier}" ]; then
  24. git -C "${third_party}/${identifier}" fetch -p
  25. git -C "${third_party}/${identifier}" reset --hard origin/master
  26. else
  27. echo "Clone ${repository}..."
  28. git -C "${third_party}" clone --recursive ${repository}
  29. fi
  30. echo "Generate '../src/tflite.js'"
  31. ${third_party}/flatbuffers/flatc --js ${third_party}/tensorflow/tensorflow/contrib/lite/schema/schema.fbs
  32. mv ./schema_generated.js ${src}/tflite.js