ModelDepot/tfjs-yolo-tiny
ModelDepot/tfjs-yolo-tiny has 534 GitHub stars and 88 forks. Star changes are not measured yet. Last checked 2026-11-14 12:34 UTC. Last push 2019-03-25.
측정된 스타 증가
- in 24h
- 기록 수집 중
- in 7 days
- 기록 수집 중
- in 15 days
- 기록 수집 중
- in 1 month
- 기록 수집 중
서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.
소개
In-Browser Object Detection using Tiny YOLO on Tensorflow.js
머신러닝README.md
Original⚡️ Fast In-Browser Object Detection 👀
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).
Demo
(You can only get so far with 1 FPS)

Install
Yarn
yarn add tfjs-yolo-tiny
Or NPM
npm install tfjs-yolo-tiny
Usage Example
import yolo, { downloadModel } from 'tfjs-yolo-tiny';
const model = await downloadModel();
const inputImage = webcam.capture();
const boxes = await yolo(inputImage, model);
// Display detected boxes
boxes.forEach(box => {
const {
top, left, bottom, right, classProb, className,
} = box;
drawRect(left, top, right-left, bottom-top, `${className} ${classProb}`)
});
API Docs
yolo(input, model, options)
Args
| Param | Type | Default | Description |
|---|---|---|---|
| input | tf.Tensor | - | Expected shape (1, 416, 416, 3) Tensor representing input image (RGB 416x416) |
| model | tf.Model | - | Tiny YOLO 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.
Example: yolo(inputImage, model, { classProbThreshold: 0.8 });
| Option | Type | Default | Description |
|---|---|---|---|
| [options.classProbThreshold] | Number |
0.4 |
Filter out classes below a certain threshold |
| [options.iouThreshold] | Number |
0.4 |
Filter out boxes that have an IoU greater than this threadhold (refer to tf.image.nonMaxSuppression) |
| [options.filterBoxesThreshold] | Number |
0.01 |
Threshold to filter out box confidence * class confidence |
| [options.maxBoxes] | Number |
2048 |
Number of max boxes to return, refer to tf.image.nonMaxSuppression. Note: The model itself can only return so many boxes. |
| [options.yoloAnchors] | tf.Tensor |
See src/postprocessing.js |
(Advanced) Yolo Anchor Boxes, only needed if retraining on a new dataset |
| [options.width] | Number |
416 |
(Advanced) If your model's input width is not 416, only if you're using a custom model |
| [options.height] | Number |
416 |
(Advanced) If your model's input height is not 416, only if you're using a custom model |
| [options.numClasses] | Number |
80 |
(Advanced) If your model has a different number of classes, only if you're using a custom model |
| [options.classNames] | Array.<String> |
See src/coco_classes.js |
(Advanced) If your model has non-MSCOCO class names, only if you're using a custom model |
Returns
Returns an array of objects.
| Property | Type | Description |
|---|---|---|
| top | Number | Pixels from top of image where bounding box starts |
| left | Number | Pixels from left of image where bounding box starts |
| bottom | Number | Pixels from top of image where box ends. |
| 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. |
downloadModel(url)
Args
| Param | Type | Default | Description |
|---|---|---|---|
| url | string | See DEFAULT_MODEL_LOCATION | Tiny YOLO Model config path. See tf.loadModel |
Returns
Returns a Promise that can resolve to a tf.Model.
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
yarn install
Run Tests
If you're running tests, make sure to yarn add @tensorflow/[email protected]
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.
yarn watch
관련 프로젝트 살펴보기
tensorflow/tensorflow
모두를 위한 오픈소스 머신러닝 프레임워크
201,595 스타huggingface/transformers
🤗 Transformers: 텍스트, 비전, 오디오, 멀티모달 분야의 최첨단 머신러닝 모델을 위한 모델 정의 프레임워크로, 추론과 학습을 모두 지원합니다.
168,964 스타AUTOMATIC1111/stable-diffusion-webui
Stable Diffusion 웹 UI
165,312 스타Comfy-Org/ComfyUI
그래프와 노드로 구성된 인터페이스를 갖춘, 가장 강력하고 모듈성이 뛰어난 확산 모델 GUI, API, 백엔드입니다. 세계에서 가장 빠른 로컬 추론 엔진입니다.
146,776 스타