nextjs-tfjs-cnn

🐕 🐈 Classifier using Keras VGG16 transfer learning with kaggle dataset.

MIT License

Stars
14

Next.js Tensorflow.js CNN

Classifier using Keras VGG16 transfer learning with kaggle dogs vs. cats dataset.

Further reading: Inference on the Browser with Tensorflow JS

Training

Use Jupyter Notebook to save Keras models as HDF5 file to ./python/output/model.h5

Convert to model of Tensorflow.js

Use tfjs-converter to convert the model format via docker image under ./python/output/model-tfjs/:

$ docker run -it --rm \
  -v "$PWD/python:/python" \
  evenchange4/docker-tfjs-converter \
  tensorflowjs_converter --input_format=keras model.h5 python/output/model-tfjs

Python 3.6.8 Tensorflowjs 1.2.6 keras 2.2.4-tf tensorflow 1.14.0

Client side

Install

yarn install --pure-lockfile

# move model to static folder
# cp -r python/output/model-tfjs static

Develop

  • node 12.10.0
  • yarn 1.17.3

Deploy

Any commits pushed to master branch.

Changelog

npm run changelog

Test

$ yarn run format
$ yarn run eslint
$ yarn run type-check
$ yarn run test:watch

CONTRIBUTING

  • Pull requests and Stars are always welcome.
  • For bugs and feature requests, please create an issue.
  • Pull requests must be accompanied by passing automated tests ($ yarn run test).

CHANGELOG

LICENSE

Reference