caffe-generate 668 B

1234567891011121314151617181920212223
  1. #!/bin/bash
  2. mkdir -p ../third_party
  3. identifier=caffe
  4. repository=https://github.com/BVLC/${identifier}.git
  5. if [ -d "../third_party/${identifier}" ]; then
  6. pushd "../third_party/${identifier}" > /dev/null
  7. echo "Fetch ${repository}..."
  8. git fetch -p
  9. echo "Reset ${repository}..."
  10. git reset --hard origin/master
  11. popd > /dev/null
  12. else
  13. echo "Clone ${repository}..."
  14. pushd "../third_party" > /dev/null
  15. git clone --recursive ${repository}
  16. popd > /dev/null
  17. fi
  18. echo "Generate '../src/caffe.js'"
  19. ../node_modules/protobufjs/bin/pbjs -t static-module -w closure -r caffe -o ../src/caffe.js ../third_party/caffe/src/caffe/proto/caffe.proto