Are you sure you want to delete this task? Once this task is deleted, it cannot be recovered.
liqingyuan02 6be9ca2ac8 | 1 year ago | |
---|---|---|
.. | ||
CMakeLists.txt | 1 year ago | |
Processor.py | 1 year ago | |
README.md | 1 year ago | |
calibrator.py | 1 year ago | |
eval_yolo_trt.py | 1 year ago | |
logging.h | 1 year ago | |
onnx_to_trt.py | 1 year ago | |
visualize.py | 1 year ago | |
yolov6.cpp | 1 year ago |
Follow the file ONNX README to convert the pt mdoel to onnx yolov6n.onnx
.
Now do't support end2end onnx model which include the nms plugin
python ./deploy/ONNX/export_onnx.py \
--weights yolov6n.pt \
--img 640 \
--batch 1
Follow the file post training README to convert and save the serialized engine file yolov6.engine
.
python3 onnx_to_tensorrt.py --fp16 --int8 -v \
--max_calibration_size=${MAX_CALIBRATION_SIZE} \
--calibration-data=${CALIBRATION_DATA} \
--calibration-cache=${CACHE_FILENAME} \
--preprocess_func=${PREPROCESS_FUNC} \
--explicit-batch \
--onnx ${ONNX_MODEL} -o ${OUTPUT}
Please follow the TensorRT Installation Guide to install TensorRT.
And you should set the TensorRT path and CUDA path in CMakeLists.txt.
If you train your custom dataset, you may need to modify the value of num_class, image width height, and class name
.
const int num_class = 80;
static const int INPUT_W = 640;
static const int INPUT_H = 640;
static const char* class_names[] = {
"person", "bicycle", "car", "motorcycle", "airplane", "bus", "train", "truck", "boat", "traffic light",
"fire hydrant", "stop sign", "parking meter", "bench", "bird", "cat", "dog", "horse", "sheep", "cow",
"elephant", "bear", "zebra", "giraffe", "backpack", "umbrella", "handbag", "tie", "suitcase", "frisbee",
"skis", "snowboard", "sports ball", "kite", "baseball bat", "baseball glove", "skateboard", "surfboard",
"tennis racket", "bottle", "wine glass", "cup", "fork", "knife", "spoon", "bowl", "banana", "apple",
"sandwich", "orange", "broccoli", "carrot", "hot dog", "pizza", "donut", "cake", "chair", "couch",
"potted plant", "bed", "dining table", "toilet", "tv", "laptop", "mouse", "remote", "keyboard", "cell phone",
"microwave", "oven", "toaster", "sink", "refrigerator", "book", "clock", "vase", "scissors", "teddy bear",
"hair drier", "toothbrush"
};
build the demo:
mkdir build
cd build
cmake ..
make
Then run the demo:
./yolov6 ../you.engine -i image_path
You can do testing on images using .trt weights, just give path of image directory & its annotation path
python3 deploy/TensorRT/eval_yolo_trt.py -v -m model.trt \
--imgs-dir /workdir/datasets/coco/images/val2017 \
--annotations /workdir/datasets/coco/annotations/instances_val2017.json \
--conf-thres 0.40 --iou-thres 0.45
YOLOv6: a single-stage object detection framework dedicated to industrial applications.
Jupyter Notebook Python C++ other
Dear OpenI User
Thank you for your continuous support to the Openl Qizhi Community AI Collaboration Platform. In order to protect your usage rights and ensure network security, we updated the Openl Qizhi Community AI Collaboration Platform Usage Agreement in January 2024. The updated agreement specifies that users are prohibited from using intranet penetration tools. After you click "Agree and continue", you can continue to use our services. Thank you for your cooperation and understanding.
For more agreement content, please refer to the《Openl Qizhi Community AI Collaboration Platform Usage Agreement》