1.0.3 • Published 5 years ago

tfjs-tiny-yolov3 v1.0.3

Weekly downloads
5
License
ISC
Repository
github
Last release
5 years ago

Tiny-YOLOv3 using TensorFlow.js

Tiny YOLO object detection with the latest version (v1.0.0) of Tensorflow.js.

Install

npm install tfjs-tiny-yolov3

Usage

Import module

import TinyYoloV3 from 'tfjs-tiny-yolov3';

Initialize and load model

const model = new TinyYoloV3();

//Optional settings
const model = new TinyYoloV3({
	nObject = 20, 
	scoreTh = .2,  
	iouTh = .3
});

// Use default models
await model.load()


// or specify path 
await model.load("https://.../model.json")

Run model

Get Output Feature Only

@param image
	Supported input html element:
	- img
	- canvas
	- video
@param flipHorizontal = true
	flip the image if input source is webcam
const features = await model.predict(image, flipHorizontal);

Detect Object and Box

const boxes = await model.detectAndBox(image, flipHorizontal);

Output box format

{
  top,    // Float
  left,   // Float
  bottom, // Float
  right,  // Float
  height, // Float
  width,  // Float
  score,  // Float
  class   // String, e.g. person
}

Credits

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago