YOLOv7 Live Detection Application on Node.js.
Serving YOLOv7 in Node.js using onnxruntime-node
.
git clone https://github.com/Hyuto/yolov7-node.git
cd yolov7-node
yarn install # Install dependencies
yarn start
YOLOv7 model converted to onnx model.
used model : yolov7-tiny
size : 24 MB
⚠️ Expensive Computation : YOLOv7 model used in this repo is the smallest with size of 24 MB, so other models is definitely bigger than this which can exhausting computation.
Use another YOLOv7 model.
-
Clone yolov7 repository
git clone https://github.com/WongKinYiu/yolov7.git && cd yolov7
Install
requirements.txt
firstpip install -r requirements.txt
Then export desired YOLOv7 model and configurations to onnx
python export.py --weights <YOLOv7-MODEL>.pt --grid --end2end --simplify \ --topk-all 100 --iou-thres 0.65 --conf-thres 0.35 --img-size 640 640 --max-wh 640
Note : You can run it on colab too
-
Copy
yolov7*.onnx
to./src
-
Update
modelInfo
inindex.js
to new model name... // model configs const modelInfo = { name: "yolov7-tiny.onnx", // change this to new model filename inputShape: [1, 3, 640, 640], // change this if model input shape isn't 640 x 640 }; ...
-
Done! 😊