Kaia.js
Kaia.ai platform's JS client library
We have not yet launched the platform. For launch announcement please follow us on Facebook.
Live Demos
- Browse sample apps for live demos, source code
Installation
Kaia.ai robot apps run on Android smartphones. To run sample apps:
- Go to kaia.ai, familiarize yourself with how the robot platform works
- Optional, but highly recommended: if you don't have Kaia.ai account, create an account
- Go to Google Play, search for "kaia.ai" to find and install Kaia.ai Android app
- Launch Kaia.ai Android app on your Android smartphone
- In Kaia.ai Android app: (optional, but highly recommended): sign in, navigate to Kaia.ai App Store
- Choose a robot app to launch
- Optionally: click the heart icon to pin the robot app to your launch screen
API Overview
TfMobile
- Sample app
- Sample app source code
- Sample app source code, built with node.js and webpack
let tfMobile = await ; // load modellet result = await tfMobile;let probabilities = resultoutput0;
TfLite
- Sample app
- Sample app source code
- Sample app source code, built with node.js and webpack
let tfLite = await ; // load modellet result = await tfLite;let probabilities = resultoutput00;
Configuration options passed to run():
// Input parameters type: 'colorBitmapAsFloat' // input data type colorBitmapAsFloat|float|int|double|long|byte|colorBitmapAsByte width: inputWidth // input layer width height: inputHeight // input layer height channels: inputChannels // input layer channels batchSize: inputBatchSize // input layer batch size imageMean: imageMean // input image mean, 0...255, default 128 imageStd: imageStd // input image standard deviation, default 128// Output parameters type: 'float' // output data type float|int|double|long|byte size: 1 1001 // output data size// Miscellaneous options useNNAPI: false // use Android NN API, default false numThreads: 0 // number of threads to use, default 0
TextToSpeech
- Sample App
- Sample app source code
textToSpeech = await ;await textToSpeech;
Serial
- Sample App
- Sample app source code
serial = await ;serial { if !err && dataevent === 'received' console;}
Installing
Via npm + webpack/rollup
npm install kaia.js
Now you can require/import kaia.js
:
;
<script>
Via dist/kaia.mjs
is a valid JS module.dist/kaia-iife.js
can be used in browsers that don't support modules.kaiaJs
is created as a global.dist/kaia-iife.min.js
As above, but minified.dist/kaia-iife-compat.min.js
As above, but works in older browsers such as IE 10.dist/kaia-amd.js
is an AMD module.dist/kaia-amd.min.js
As above, but minified.
These built versions are also available on jsDelivr, e.g.:
<!-- Or in modern browsers: -->
and unpkg
<!-- Or in modern browsers: -->
Customizing NN Model
- To make a custom TfMobile model please follow a detailed Google Codelabs TFMobile tutorial
- To make a custom TfLite model please follow a detailed Google Codelabs TFLite tutorial
Deprecations
- Expect TextToSpeech to be eventually deprecated in favor of Web text-to-speech API.
- Expect Serial API to be eventually deprecated in favor of WebUSB