Skip to main content

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

Metadata

Release files for yolov5-detect 0.1.21

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for yolov5-detect 0.1.21
File Size Uploaded Provenance Actions
yolov5-detect-0.1.21.tar.gz 77.6 kB Without provenance Details for yolov5-detect-0.1.21.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for yolov5-detect 0.1.21
File Interpreter ABI Platform Actions
yolov5_detect-0.1.21-py3-none-any.whl Python 3 none any Details for yolov5_detect-0.1.21-py3-none-any.whl

Total release size: 190.4 kB

Release files / yolov5-detect-0.1.21.tar.gz

Download URL yolov5-detect-0.1.21.tar.gz
Size 77.6 kB
Tags Source
SHA-256 checksum
How to use checksums
41ce52598740bd2524f2ba3da7b46c13fa7ea7c18eb7f29a5efac5b9cd33b9f0
BLAKE2b-256 checksum
How to use checksums
f8a3e84cb1732aba8527fa019b2d73204c2fdfb4c8a8fa088620c61912425c72
Upload date
Uploaded using Trusted Publishing?
What is 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

Release files / yolov5_detect-0.1.21-py3-none-any.whl

Download URL yolov5_detect-0.1.21-py3-none-any.whl
Size 112.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f6107d7ea6d509623382e0e2eb4ee5ef142abc5fd8946d544efaa338999ce056
BLAKE2b-256 checksum
How to use checksums
efa099f0b3e1694f18ecebc2e3d946e0976783a407ab2e8b4038dbca8434ccea
Upload date
Uploaded using Trusted Publishing?
What is 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

Security for yolov5-detect 0.1.21

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page