HuggingFace utilities for Ultralytics/YOLOv8.
Project description
ultralytics+
Extra features for ultralytics/ultralytics.
installation
pip install ultralyticsplus
push to 🤗 hub
ultralyticsplus --exp_dir runs/detect/train --hf_model_id HF_USERNAME/MODELNAME
load from 🤗 hub
from ultralyticsplus import YOLO, render_result
# load model
model = YOLO('HF_USERNAME/MODELNAME')
# set model parameters
model.overrides['conf'] = 0.25 # NMS confidence threshold
model.overrides['iou'] = 0.45 # NMS IoU threshold
model.overrides['agnostic_nms'] = False # NMS class-agnostic
model.overrides['max_det'] = 1000 # maximum number of detections per image
# set image
image = 'https://github.com/ultralytics/yolov5/raw/master/data/images/zidane.jpg'
# perform inference
results = model.predict(image, imgsz=640)
# parse results
result = results[0]
boxes = result.boxes.xyxy # x1, y1, x2, y2
scores = result.boxes.conf
categories = result.boxes.cls
scores = result.probs # for classification models
masks = result.masks # for segmentation models
# show results on image
render = render_result(model=model, image=image, result=result)
render.show()
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
ultralyticsplus-0.1.0.tar.gz
(25.4 kB
view details)
Built Distribution
File details
Details for the file ultralyticsplus-0.1.0.tar.gz
.
File metadata
- Download URL: ultralyticsplus-0.1.0.tar.gz
- Upload date:
- Size: 25.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.12.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c3e0fdff06bd331a92ccb774ee709da80d4f040caf7c1fa2b4d994918e9b0418 |
|
MD5 | 5f049deb99b631a51e1377b4c4105da7 |
|
BLAKE2b-256 | 3fbb87c1c17ddc930fe1adbea4720b197e5230ce38d0d3f3bf6d0ce6f9e70ad7 |
File details
Details for the file ultralyticsplus-0.1.0-py3-none-any.whl
.
File metadata
- Download URL: ultralyticsplus-0.1.0-py3-none-any.whl
- Upload date:
- Size: 23.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.12.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 26275c16ba638d9fc5357b2dcf508e4477bd0031ed096d9892670717326e2f92 |
|
MD5 | 16709699367db82e953f329ba69a1605 |
|
BLAKE2b-256 | 276cff87519141c81e7a4b47c0fa8831e5e4100cf4f3c2db940f159219e30e59 |