Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/skalskip/yolov5js

Effortless YOLOv5 javascript deployment
https://github.com/skalskip/yolov5js

ai deep-learning deep-neural-networks javascript machine-learning tensorflowjs typescript yolo yolov5

Last synced: 3 months ago
JSON representation

Effortless YOLOv5 javascript deployment

Awesome Lists containing this project

README

        

![npm](https://img.shields.io/npm/dt/yolov5js)
![NPM](https://img.shields.io/npm/l/yolov5js)
![npm](https://img.shields.io/npm/v/yolov5js)

[![CodeSandbox](https://img.shields.io/badge/Codesandbox-040404?style=for-the-badge&logo=codesandbox&logoColor=DBDBDB)](https://codesandbox.io/s/github/SkalskiP/yolov5js-example)

yolov5.js


Logo

##

Install

```bash
npm install --save yolov5js
```

##

Example

Want to use **yolov5js** in your project but don't know how? Take a peek at our sample React
[app](https://github.com/SkalskiP/yolov5js-example) or run it in
[codesandbox](https://codesandbox.io/s/github/SkalskiP/yolov5js-example).

##

Convert

```bash
# clone YOLOv5 repository
git clone https://github.com/ultralytics/yolov5.git
cd yolov5

# create python virtual environment [recommended]
virtualenv venv
source venv/bin/activate

# install dependencies
pip install -r requirements.txt
pip install tensorflowjs

# convert model to tensorflow.js format
python export.py --weights yolov5s.pt --include tfjs
```

##

Zoo

Use and share pretrained YOLOv5 tensorflow.js models with [yolov5.js-zoo](https://github.com/SkalskiP/yolov5js-zoo).

##

Documentation

Our proper [documentation](skalskip.github.io/yolov5js) are still under construction 🚧. We are working on it really
hard.

Load pre-trained model from zoo

```javascript
import {load, YOLO_V5_N_COCO_MODEL_CONFIG} from 'yolov5js'

const model = await load(YOLO_V5_N_COCO_MODEL_CONFIG)
```

Load custom model from file

```javascript
import {load, ModelConfig} from 'yolov5js'

const uploadJSONInput = document.getElementById('upload-json');
const uploadWeightsInput = document.getElementById('upload-weights');

const config = { source: [uploadJSONInput.files[0], uploadWeightsInput.files[0]] }
const model = await load(config)
```

##

Kudos

Kudos to [ultralytics](https://ultralytics.com/) team as well as all other open-source contributors for building [YOLOv5](https://github.com/ultralytics/yolov5) project, and making it all possible.

##

License

Project is freely distributable under the terms of the [MIT license](LICENSE).