6 Star 7 Fork 7

DeepSpark/DeepSparkInference

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
README.md 2.06 KB
一键复制 编辑 原始数据 按行查看 历史
majorli6 提交于 2024-06-19 09:53 . add ixrt models to model list - part 2

YOLOv5s

Description

The YOLOv5 architecture is designed for efficient and accurate object detection tasks in real-time scenarios. It employs a single convolutional neural network to simultaneously predict bounding boxes and class probabilities for multiple objects within an image. The YOLOV5s is a tiny model.

Setup

Install

# Install libGL
## CentOS
yum install -y mesa-libGL
## Ubuntu
apt install -y libgl1-mesa-dev

pip3 install tqdm
pip3 install onnx
pip3 install onnxsim
pip3 install ultralytics
pip3 install pycocotools

Download

Pretrained model: https://github.com/ultralytics/yolov5/releases/download/v6.1/yolov5s.pt

Dataset: http://images.cocodataset.org/zips/val2017.zip to download the validation dataset.

Model Conversion


mkdir checkpoints
git clone https://github.com/ultralytics/yolov5
# 切换到需要的版本分支
git checkout v6.1

# 有一些环境需要安装
wget https://ultralytics.com/assets/Arial.ttf
cp Arial.ttf  /root/.config/Ultralytics/Arial.ttf

# 转换为onnx (具体实现可以参考 export.py 中的 export_onnx 函数)
python3 export.py --weights yolov5s.pt --include onnx --opset 11 --batch-size 32
mv yolov5s.onnx /Path/to/checkpoints

Inference

export PROJ_DIR=/Path/to/yolov5s/ixrt
export DATASETS_DIR=/Path/to/coco2017/
export CHECKPOINTS_DIR=./checkpoints
export COCO_GT=${DATASETS_DIR}/annotations/instances_val2017.json
export EVAL_DIR=${DATASETS_DIR}/val2017
export RUN_DIR=${PROJ_DIR}/
export CONFIG_DIR=config/YOLOV5S_CONFIG

FP16

# Accuracy
bash scripts/infer_yolov5s_fp16_accuracy.sh
# Performance
bash scripts/infer_yolov5s_fp16_performance.sh

INT8

# Accuracy
bash scripts/infer_yolov5s_int8_accuracy.sh
# Performance
bash scripts/infer_yolov5s_int8_performance.sh

Results

Model BatchSize Precision FPS MAP@0.5 MAP@0.5:0.95
YOLOv5s 32 FP16 1112.66 0.565 0.370
YOLOv5s 32 INT8 2440.54 0.557 0.351
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Python
1
https://gitee.com/deep-spark/deepsparkinference.git
git@gitee.com:deep-spark/deepsparkinference.git
deep-spark
deepsparkinference
DeepSparkInference
master

搜索帮助

Cb406eda 1850385 E526c682 1850385