dle234 / yolov5-tfjs

YOLOv5 right in your browser with tensorflow.js

Home Page:https://hyuto.github.io/yolov5-tfjs/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Object Detection using YOLOv5 and Tensorflow.js

love tensorflow.js


More Feature Version


Object Detection application right in your browser. Serving YOLOv5 in browser using tensorflow.js with webgl backend.

Setup

git clone https://github.com/Hyuto/yolov5-tfjs.git
cd yolov5-tfjs
yarn install #Install dependencies

Scripts

yarn start # Start dev server
yarn build # Build for productions

Model

YOLOv5n model converted to tensorflow.js.

used model : yolov5n
size       : 7.5 Mb

Use another model

Use another YOLOv5 model.

  1. Clone yolov5 repository

    git clone https://github.com/ultralytics/yolov5.git && cd yolov5

    Install requirements.txt first

    pip install -r requirements.txt
  2. Export model to tensorflow.js format

    export.py --weights yolov5*.pt --include tfjs
  3. Copy yolov5*_web_model to ./public

  4. Update modelName in App.jsx to new model name

    ...
    // model configs
    const modelName = "yolov5*"; // change to new model name
    const classThreshold = 0.25;
    ...
  5. Done! 😊

Reference

https://github.com/ultralytics/yolov5

About

YOLOv5 right in your browser with tensorflow.js

https://hyuto.github.io/yolov5-tfjs/


Languages

Language:JavaScript 83.3%Language:CSS 14.5%Language:HTML 2.2%