Skip to main content

YOLOv5 model conversion CLI

Project description

上传步骤

在你的项目根目录(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

yolo_convert -i yolov5.pt

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

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

动态分辨率

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 --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

3403

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

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

3519

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

yolo_convert -i yolov5.pt --hisi3519 --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.4.tar.gz (231.3 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.4-py3-none-any.whl (265.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: yolo_convert-0.1.4.tar.gz
  • Upload date:
  • Size: 231.3 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.4.tar.gz
Algorithm Hash digest
SHA256 324d178558f625c89d91c4fb213b973ac3506822aefb2baa6cb0aff62b0e3a43
MD5 7f0ff298e87450d95de76d17ee7a84d7
BLAKE2b-256 41ded8f6423b3aa074346f27bf5d2fbbd57b0d5c76bdc6d853c8ea41e7a3e404

See more details on using hashes here.

File details

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

File metadata

  • Download URL: yolo_convert-0.1.4-py3-none-any.whl
  • Upload date:
  • Size: 265.3 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.4-py3-none-any.whl
Algorithm Hash digest
SHA256 775fe4d0a3a857b7dd29a8f68552861b8f2430882591bbd1191fbd64084c182c
MD5 36e08598274f45ca875d58c4ed6e392e
BLAKE2b-256 397ebd948382d46ad76263b8ac7c81d19b753e8f1e5109422a465e1c9528a679

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