From 18d33d78fd356ad9cefa129f34526c17e517c77e Mon Sep 17 00:00:00 2001 From: Marcos Luciano Date: Mon, 3 May 2021 21:24:51 -0300 Subject: [PATCH] Update YOLOv5-4.0 --- YOLOv5-4.0.md | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/YOLOv5-4.0.md b/YOLOv5-4.0.md index af51329..349d2de 100644 --- a/YOLOv5-4.0.md +++ b/YOLOv5-4.0.md @@ -48,7 +48,7 @@ git clone -b yolov5-v4.0 https://github.com/wang-xinyu/tensorrtx.git git clone -b v4.0 https://github.com/ultralytics/yolov5.git ``` -2. Download latest YoloV5 (YOLOv5s, YOLOv5m, YOLOv5l or YOLOv5x) weights to yolov5 folder (example for YOLOv5s) +2. Download latest YoloV5 (YOLOv5s, YOLOv5m, YOLOv5l or YOLOv5x) weights to yolov5/weights directory (example for YOLOv5s) ``` wget https://github.com/ultralytics/yolov5/releases/download/v4.0/yolov5s.pt -P yolov5/weights ``` @@ -66,6 +66,16 @@ python3 gen_wts.py yolov5s.wts file will be generated in yolov5 folder +
+ +Note: if you want to generate wts file to another YOLOv5 model (YOLOv5m, YOLOv5l or YOLOv5x), edit get_wts.py file changing yolov5s to your model name +``` +model = torch.load('weights/yolov5s.pt', map_location=device)['model'].float() # load to FP32 +model.to(device).eval() + +f = open('yolov5s.wts', 'w') +``` + ## ### Convert wts file to TensorRT model