tensorflow-serving-node-typescript-client
TypeScript icon, indicating that this package has built-in type declarations

0.0.10 • Public • Published

Tensorflow Serving Client

Targeting Node.js (v6) and TypeScript

Provides:

  • Prediction of images;
  • And that's it so far.

Usage Example

import TensorflowServingClient = require( "tensorflow-serving-node-typescript-client");
import fs = require('fs');

class TensorflowServing {

    private client: any;
    private imagePath: string = "path/to/image.jpg";

    public constructor() {
        this.client = new TensorflowServingClient.TensorflowServingClient("localhost:9000");
    }

    public predict(): void {
        try {
            let buffer = fs.readFileSync(this.imagePath);
            this.client.Predict(buffer)
                .then((result) => {
                    console.log(result);
                })
                .catch((error) => {
                    console.log(error);
                })
        }
        catch (e) {
            console.log(e);
        }
    }
}

export = TensorflowServing;   
Notes
  • This is a work in progress, feel free to improve it.

Readme

Keywords

none

Package Sidebar

Install

npm i tensorflow-serving-node-typescript-client

Weekly Downloads

2

Version

0.0.10

License

MIT

Last publish

Collaborators

  • jorgefilipemlima