Skip to main content

simple yolov5 wrapper for detect(onnx, dnn, openvino)

Project description

YOLOv5 detect

🚀simple yolov5 wrapper for detect(onnx, dnn, openvino)

Installation

pip install yolov5-detect

Example

import cv2

from pathlib import Path
from yolov5detect import detect, annotation

output = Path("output dir")
if not output.exists():
    output.mkdir()

yolo = detect.YoloDetect("test.onnx", "test.yaml", 1000)
names = yolo.get_names()

root = Path("images dir")

for item in root.rglob("*.jpg"):  # detect all images and save label results
    img = cv2.imread(str(item))
    det = yolo.detect(img.copy(), 0.4)
    if len(det) > 0:
        annotator = annotation.Annotator(img.copy())
        for *xyxy, conf, cls in det:
            annotator.box_label(xyxy, f"{names[int(cls)]} {conf:.2f}")
        cv2.imwrite(annotator.result(), str(output / item.name))

Reference

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

yolov5-detect-0.1.21.tar.gz (77.6 kB view details)

Uploaded Source

Built Distribution

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

yolov5_detect-0.1.21-py3-none-any.whl (112.8 kB view details)

Uploaded Python 3

File details

Details for the file yolov5-detect-0.1.21.tar.gz.

File metadata

  • Download URL: yolov5-detect-0.1.21.tar.gz
  • Upload date:
  • Size: 77.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.10.0 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/1.0.0 urllib3/1.26.18 tqdm/4.64.1 importlib-metadata/4.8.3 keyring/23.4.1 rfc3986/1.5.0 colorama/0.4.5 CPython/3.6.15

File hashes

Hashes for yolov5-detect-0.1.21.tar.gz
Algorithm Hash digest
SHA256 41ce52598740bd2524f2ba3da7b46c13fa7ea7c18eb7f29a5efac5b9cd33b9f0
MD5 ec6fc5d6178da22fe1d2d3cdff7ee4d0
BLAKE2b-256 f8a3e84cb1732aba8527fa019b2d73204c2fdfb4c8a8fa088620c61912425c72

See more details on using hashes here.

File details

Details for the file yolov5_detect-0.1.21-py3-none-any.whl.

File metadata

  • Download URL: yolov5_detect-0.1.21-py3-none-any.whl
  • Upload date:
  • Size: 112.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.10.0 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/1.0.0 urllib3/1.26.18 tqdm/4.64.1 importlib-metadata/4.8.3 keyring/23.4.1 rfc3986/1.5.0 colorama/0.4.5 CPython/3.6.15

File hashes

Hashes for yolov5_detect-0.1.21-py3-none-any.whl
Algorithm Hash digest
SHA256 f6107d7ea6d509623382e0e2eb4ee5ef142abc5fd8946d544efaa338999ce056
MD5 0db54ebb3f6e34d2ee26c021fb4250a6
BLAKE2b-256 efa099f0b3e1694f18ecebc2e3d946e0976783a407ab2e8b4038dbca8434ccea

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