Demo of using a mobilenet network with tensorflow.js as a cloud function to perform image recognition from the command line.
Switch branches/tags
Nothing to show
Clone or download
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
cf-worker working demo on ibmcloud Oct 31, 2018
orig working demo on ibmcloud Oct 31, 2018
tfjs-lambda working demo on ibmcloud Oct 31, 2018
.gitignore working demo on ibmcloud Oct 31, 2018
README.md update readme for demo Nov 16, 2018
bird.jpg update readme for demo Nov 16, 2018
panda.jpg update readme for demo Nov 16, 2018

README.md

Links

Heavily based off of a blog post by James Thomas.

Test commands

(echo -n '{"image": "'; base64 ./panda.jpg; echo '"}') | curl -u 268a0fa1-6af8-4a6e-bb58-1e3ef8113ad7:pGOaYxUb1wLhzDa47Mk9dmLpsLxjIIHPZcvt9fDDk3bu0YTBTfyDvSQ2R5MhA3ob -d @- -H "Content-Type: application/json" -X POST https://openwhisk.ng.bluemix.net/api/v1/namespaces/brett%40quarkworks.co_dev/actions/classify?blocking=true
(echo -n '{"image": "'; base64 ./bird.jpg; echo '"}') | curl -u 268a0fa1-6af8-4a6e-bb58-1e3ef8113ad7:pGOaYxUb1wLhzDa47Mk9dmLpsLxjIIHPZcvt9fDDk3bu0YTBTfyDvSQ2R5MhA3ob -d @- -H "Content-Type: application/json" -X POST https://openwhisk.ng.bluemix.net/api/v1/namespaces/brett%40quarkworks.co_dev/actions/classify?blocking=true

Notes

if you deploy your own ibmcloud instance, you can create your own:

ibmcloud fn action update classify --docker jamesthomas/action-nodejs-v8:tfjs index.js

then invoke:

ibmcloud fn action invoke classify -r -p image $(base64 panda.jpg)