Skip to content

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

License

Notifications You must be signed in to change notification settings

evenchange4/nextjs-tfjs-cnn

Repository files navigation

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

screenshot

Input data type Task type Model type Training Inference Save-load operations
Image Multiclass classification (transfer learning) Convolutional neural network Python Browser Export trained model from Keras and load it in browser

architecture

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).

Reference

About

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

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •  

Languages