Skip to content

jfmlima/tensorflow-serving-node-typescript-client

Repository files navigation

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.

About

Tensorflow Serving Client in Node.js + Typescript

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published