New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

customvision-tfjs

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

customvision-tfjs

Library for Tensorflow.js models exported from customvision.ai

1.0.1
latest
Source
npm
Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

customvision-tfjs

NPM package for TensorFlow.js models exported from Custom Vision Service

Install

npm install customvision-tfjs

Usage

<img id="image" src="test_image.jpg" />

Classification

import * as cvs from 'customvision-tfjs';
let model = new cvs.ClassificationModel();
await model.loadModelAsync('model.json');
const image = document.getElementById('image');
const result = await model.executeAsync(image);

The result is a 1D-array of probabilities.

Object Detection

import * as cvs from 'customvision-tfjs';
let model = new cvs.ObjectDetectionModel();
await model.loadModelAsync('model.json');
const image = document.getElementById('image');
const result = await model.executeAsync(image);

The result has 3 arrays.


[
	[[0.1, 0.3, 0.4, 0.3], [0.2, 0.4, 0.8, 0.9]], // bounding boxes (x1, y1, x2, y2)
	[0.2, 0.3], // probabilities
	[1, 4] // class ids
]

FAQs

Package last updated on 31 Oct 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts