Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/brucecatyu/yolov5-detect
simple yolov5 wrapper for detect(onnx, dnn, openvino)
https://github.com/brucecatyu/yolov5-detect
deep-learning detection opencv opencv-python openvino python yolov5
Last synced: 11 days ago
JSON representation
simple yolov5 wrapper for detect(onnx, dnn, openvino)
- Host: GitHub
- URL: https://github.com/brucecatyu/yolov5-detect
- Owner: BruceCatYu
- License: gpl-3.0
- Created: 2022-02-23T06:07:44.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2024-03-08T08:04:45.000Z (8 months ago)
- Last Synced: 2024-10-30T00:34:11.574Z (18 days ago)
- Topics: deep-learning, detection, opencv, opencv-python, openvino, python, yolov5
- Language: Python
- Homepage:
- Size: 447 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# YOLOv5 detect
πsimple yolov5 wrapper for detect(onnx, dnn, openvino)
## Installation
```bash
pip install yolov5-detect
```## Example
```python
import cv2from pathlib import Path
from yolov5detect import detect, annotationoutput = 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
* https://github.com/ultralytics/yolov5
* https://github.com/mikel-brostrom/Yolov5_DeepSort_Pytorch