⚡️ Fast In-Browser Object Detection 👀 Detect objects in images right in your browser using Tensorflow. Currently takes ~800ms to analyze each frame on Chrome MBP 13" mid-2014. Supports , as of right now, does not have support to run any full YOLO models (and your user's computers probably can't handle it either). Tensor | - | Expected shape (1, 416, 416, 3) Tensor representing input image (RGB 416x416) model | tf. Model [options] | Object | See Below | Optional, Additional Configs If you're using a custom
Tiny YOLO model or want to adjust the default filtering cutoffs, you may do so by passing an additional options object. classProbThreshold] | | | Filter out classes below a certain threshold | | [options. iouThreshold] | | | Filter out boxes that have an IoU greater than this threadhold (refer to tf. filterBoxesThreshold] | | | Threshold to filter out box confidence * class confidence | | [options. maxBoxes] | | | Number of max boxes to return, refer to tf. Note: The model itself can only return so many boxes. yoloAnchors] | | | (Advanced) Yolo Anchor Boxes
, only needed if retraining on a new dataset | | [options. width] | | | (Advanced) If your model's input width is not 416, only if you're using a custom model | | [options. height] | | | (Advanced) If your model's input height is not 416, only if you're using a custom model | | [options. numClasses] | | | (Advanced) If your model has a different number of classes, only if you're using a custom model | | [options. classNames] | | | (Advanced) If your model has non-MSCOCO class names, only if you're using a custom
model | Returns Returns an array of objects. right | Number | Pixels from left of image where box ends. classProb | Number | Probability of the class in the bounding box. className | String | Human name of the class. loadModel Returns Returns a that can resolve to a . Contributing PR's are more than welcome! Perf improvement or better test coverage are probably the two biggest areas of immediate need. If you have thoughts on extensibility as well, feel free to open an issue! Install Dependencies
Run Tests If you're running tests, make sure to so that you you don't get tfjs package not found errors. If you're developing, make sure to remove tfjs as a dependency, as it'll start using the local version of intead of the peer version. Note: Test coverage is poor, definitely don't rely on them to catch your errors. Build Or during development, use watch mode, you can use the demo app to test out changes.
Detect objects in images right in your browser using Tensorflow.js! Currently takes ~800ms
to analyze each frame on Chrome MBP 13" mid-2014.
Supports Tiny YOLO, as of right now,
tfjs does not have
support to run any full YOLO models (and your user's computers probably
can't handle it either).
PR's are more than welcome! Perf improvement or better test coverage
are probably the two biggest areas of immediate need. If you have thoughts
on extensibility as well, feel free to open an issue!
Install Dependencies
yarn install
Run Tests
If you're running tests, make sure to yarn add @tensorflow/tfjs@0.7.0
so that you you don't get tfjs package not found errors. If you're developing,
make sure to remove tfjs as a dependency, as it'll start using the
local version of tfjs intead of the peer version.
Note: Test coverage is poor, definitely don't rely on them to catch your errors.
yarn test
Build
yarn build
Or during development, use watch mode, you can use the demo app
to test out changes.