Skip to main content

YOLOv5 model conversion CLI

Project description

上传步骤

首先设定版本号,在pyproject.toml里修改,每次版本号不能重名 然后在项目根目录(pyproject.toml 所在目录)执行:

python -m build
  • 这个命令会生成一个 dist/ 文件夹。
  • 文件通常是:
    • yolo_convert-0.1.0-py3-none-any.whl
    • yolo_convert-0.1.0.tar.gz

再上传包:

twine upload dist/*

本地开发

pip uninstall yolo-convert      # 卸载 PyPI 版本,避免冲突
pip install -e .                # 安装本地 editable 版本
yolo_convert -i yolov5s.pt

安装测试

安装python环境

pip install yolo-convert

导出Yolov5模型,一个输出

默认分辨率640x640、opset版本12、linux系统

yolo_convert -i yolov5.pt

修改分辨率为1024x1280(h,w),opset设置13,设置windows系统

yolo_convert -i yolov5.pt --img 1024 1280 --opset 13 --win

动态分辨率

yolo_convert -i yolov5.pt --dynamic 

导出Yolov5模型,三个输出

固定分辨率

yolo_convert -i yolov5.pt --hisi3559 --img 1024 1280

动态分辨率

yolo_convert -i yolov5.pt --hisi3559 --dynamic

Atlas

Atlas动态分辨率+后处理算子导出,--class-num指定类别个数,--biases默认不变,如果改变需要重新传anchor,第一个数为float型(带点,如10.0)

yolo_convert -i yolov5.pt --atlas --dynamic --class-num 3 --conf-thres 0.01 --iou-thres 0.99 --biases 10.0 13 16 30 33 23 30 61 62 45 59 119 116 90 156 198 373 326

如果训练后的anchor保持不变,可简化为:

yolo_convert -i yolov5.pt --atlas --dynamic --class-num 3 --conf-thres 0.01 --iou-thres 0.99

3403

3403后处理算子导出,只支持固定分辨率,加--dynaic会报错,只加入--img h w

yolo_convert -i yolov5.pt --hisi3403 --conf-thres 0.01 --iou-thres 0.99 --img 1024 1280

3519

3519后处理算子导出,同3403,只支持固定分辨率,加--dynaic会报错,只加入--img h w

yolo_convert -i yolov5.pt --hisi3519 --conf-thres 0.01 --iou-thres 0.99 --img 1024 1280

Tensorrt efficientNms

Tensorrt导出带efficientNms plugin,只支持动态分辨率

yolo_convert -i yolov5s.pt --tensorrt --dynamic

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

yolo_convert-0.1.7.tar.gz (231.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

yolo_convert-0.1.7-py3-none-any.whl (265.4 kB view details)

Uploaded Python 3

File details

Details for the file yolo_convert-0.1.7.tar.gz.

File metadata

  • Download URL: yolo_convert-0.1.7.tar.gz
  • Upload date:
  • Size: 231.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.11

File hashes

Hashes for yolo_convert-0.1.7.tar.gz
Algorithm Hash digest
SHA256 ac50a092cd589332f1984659a696f70f8e67271531216e083915e3caa12c43dd
MD5 1e9312291127b8ab2074d28589cacd2e
BLAKE2b-256 f262fd084eb3448717106766662419273a399627b79fc5de569746769694f87d

See more details on using hashes here.

File details

Details for the file yolo_convert-0.1.7-py3-none-any.whl.

File metadata

  • Download URL: yolo_convert-0.1.7-py3-none-any.whl
  • Upload date:
  • Size: 265.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.11

File hashes

Hashes for yolo_convert-0.1.7-py3-none-any.whl
Algorithm Hash digest
SHA256 7eed2ba7779c3af6dff8a43f2054aad265bcc741ff8d48f0b43baf767af139e7
MD5 fb0eac0f7d10abd7eab19b0c8e4dcf4b
BLAKE2b-256 ef43d3d8f4d71b701ebbac9e54cd237997c10f342c0f391979b03cf0273d568e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page