# yolov8_detect_py
**Repository Path**: mr-hanlu/yolov8_detect_py
## Basic Information
- **Project Name**: yolov8_detect_py
- **Description**: yolov8 检测和分割 onnxruntime openvino tensorrt python推理代码
- **Primary Language**: Python
- **License**: Apache-2.0
- **Default Branch**: master
- **Homepage**: None
- **GVP Project**: No
## Statistics
- **Stars**: 1
- **Forks**: 1
- **Created**: 2023-07-17
- **Last Updated**: 2025-02-23
## Categories & Tags
**Categories**: Uncategorized
**Tags**: None
## README
### yolov8分割检测关键点模型推理速度对比
yolov8_s 80类[3*640*640]图推理时间对比_i5-10400F+1650显卡 |
推理框架 |
推理语言 |
CPU/GPU |
detect推理time(ms) |
segment推理time(ms) |
keypoint推理time(ms) |
备注 |
Pytorch |
python |
CPU |
160 |
225 |
170 |
|
GPU |
20 |
26 |
21 |
检测图大小是动态形状,加最小黑边,所以快 |
OnnxRuntime |
python |
CPU |
110 |
150 |
120 |
|
GPU |
29 |
37 |
30 |
以detect为例,python和c++速度一样 |
Tensorrt |
24 |
31 |
24 |
启动速度慢,第一次推理时间很长,GPU占用率高于直接用GPU |
openvino |
python |
CPU |
65 |
95 |
70 |
|
TensorRT |
python |
GPU_int8 |
15 |
19 |
15 |
int8量化完小目标可能会丢 |
GPU_fp16 |
17 |
22 |
17 |
|
GPU_fp32 |
24 |
30 |
24 |
|
C++ |
GPU_int8 |
13 |
19 |
13 |
|
GPU_fp16 |
15 |
23 |
15 |
|
GPU_fp32 |
22 |
30 |
22 |
c++前处理和网络推理比python各快1ms |
**总结:**
1. python部署图片固定大小用OnnxRuntime(量化fp16速度变慢,量化int8精度丢失严重,直接使用默认模型)
2. 服务端CPU部署使用OpenVINO
3. 服务端GPU部署使用TensorRT(FP16速度快,int8会损失部分小目标,需要针对任务实际测试)