Skip to main content

easyolo python library

Project description

EasYoloD

Easy Yolo Detect

用户快速部署yolo的识别程序,支持onnxruntime, opencv(dnn), openvino

仅需简短几行代码即可实现yolo目标检测

Provider 介绍

  1. onnxruntime:
    • cpu: 适配性最高的版本,不需要GPU即可执行
    • gpu: onnxruntime-gpu 需要英伟达GPU,并且安装对应版本cuda,cudnn之后才能使用,速度快
    • onnxdml: onnxruntime-directml 不需要使用特定GPU,核显也可以允许,而且不需要安装任何额外程序,速度一般,而且仅适用与windos系统
  2. openvino:
    • cpu: 同onnx的cpu一样
    • gpu: 仅适用于intel的GPU,其他GPU不可用
  3. opencv:
    • cpu: 同上
    • gpu: 需要单独编译带有cuda的opencv包,并正确配置路径,并且安装好cuda和cudnn,速度快

安装和使用

pip install EasYoloD

Requirements

  • Python 3.8-3.12
  • opencv-python <= 4.10.0.84
  • numpy <= 1.26

使用:

import EasYoloD

EasYoloD.init(provider='onnxruntime',gpu=False) # onnxruntime-directml 则使用onnxdml,openvino使用 openvino
model = EasYoloD.Model()
# conf 置信度
# ious
# namse 可以是文件,也可以是一个list
model.load('modelpath', conf, ious, names)
# or 你使用的是opencv dnn yolov4的weight模型
# model.load('config path', 'weight path', inputsize, names, conf, nms)

result = model.detect(img=image)
# or 你希望自己处理输出
# result = model.detect_only(img=image)

输出示例:

detect:

{
  1: [
    {'confidence': 0.89, 'box': [(614, 202), (732, 242)], 'center': (673, 222)}, 
    {'confidence': 0.87, 'box': [(975, 227), (1105, 268)], 'center': (1040, 247)}, 
    {'confidence': 0.87, 'box': [(845, 241), (962, 284)], 'center': (903, 262)}, 
    {'confidence': 0.86, 'box': [(418, 203), (495, 243)], 'center': (456, 223)}, 
    {'confidence': 0.85, 'box': [(713, 233), (822, 273)], 'center': (767, 253)}, 
    {'confidence': 0.83, 'box': [(776, 222), (888, 261)], 'center': (832, 241)}
  ], 
  2: [], 
  3: [
    {'confidence': 0.8, 'box': [(664, 265), (687, 289)], 'center': (675, 277)}
  ], 
  4: [
    {'confidence': 0.86, 'box': [(846, 195), (955, 236)], 'center': (900, 215)}, 
    {'confidence': 0.84, 'box': [(1108, 227), (1208, 273)], 'center': (1158, 250)}
  ], 
  5: [], 
  6: [], 
  7: []
}

detect_only:

(array([[ 614.5011 ,  202.27354,  732.4082 ,  242.74388],
       [ 975.4805 ,  227.59409, 1105.0723 ,  268.69995],
       [ 845.77277,  241.3953 ,  962.0877 ,  284.1887 ],
       [ 418.44012,  203.71834,  495.6739 ,  243.37538],
       [ 846.04956,  195.53143,  955.15515,  236.9972 ],
       [ 713.3884 ,  233.3027 ,  822.95776,  273.27628],
       [1108.0188 ,  227.39557, 1208.6423 ,  273.43536],
       [ 776.30786,  222.16605,  888.85815,  261.70145],
       [ 664.80615,  265.0358 ,  687.7573 ,  289.32138]], dtype=float32), array([0.88843024, 0.86892086, 0.8652373 , 0.8610253 , 0.858262  ,
       0.84596515, 0.8361889 , 0.83084583, 0.8002863 ], dtype=float32), array([0, 0, 0, 0, 3, 0, 3, 0, 2], dtype=int64))

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

easyolod-0.1.8.tar.gz (8.5 kB view details)

Uploaded Source

Built Distribution

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

easyolod-0.1.8-py3-none-any.whl (8.7 kB view details)

Uploaded Python 3

File details

Details for the file easyolod-0.1.8.tar.gz.

File metadata

  • Download URL: easyolod-0.1.8.tar.gz
  • Upload date:
  • Size: 8.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.13

File hashes

Hashes for easyolod-0.1.8.tar.gz
Algorithm Hash digest
SHA256 c8f1e72b2965158976e115188b375e3303600000ac294c2d92b9274b5f91597b
MD5 32de8962964ab928a17aa4f2eb4e390f
BLAKE2b-256 2f6d0ec146ac26e79c502f522c6cca17f9bd036d3a159529cedc38ee8a8941dd

See more details on using hashes here.

File details

Details for the file easyolod-0.1.8-py3-none-any.whl.

File metadata

  • Download URL: easyolod-0.1.8-py3-none-any.whl
  • Upload date:
  • Size: 8.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.13

File hashes

Hashes for easyolod-0.1.8-py3-none-any.whl
Algorithm Hash digest
SHA256 b05603c0e33125ada2ea5be268257216cf4fe2b9714557a13dc8092f1bf55265
MD5 b1a84febb26d75afc52d1b2ee06aff0b
BLAKE2b-256 94e130eadcc56cd3a244a4147edf302c5624a948097c7f2fbc971837480a6c33

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