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.0.17.tar.gz
(10.5 kB
view details)
Built Distribution
File details
Details for the file ultralyticsplus-0.0.17.tar.gz
.
File metadata
- Download URL: ultralyticsplus-0.0.17.tar.gz
- Upload date:
- Size: 10.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a65ac5a025b70d95a368f1fa2b8a8dd7984ffe10ee8423252d2c5e7284a309c7 |
|
MD5 | f3926c26915e8d31f97b7f592d443341 |
|
BLAKE2b-256 | de4a686361de3f4651ae95c61c195ed639aab2cabc34dc429230e654f681e2e4 |
Provenance
File details
Details for the file ultralyticsplus-0.0.17-py3-none-any.whl
.
File metadata
- Download URL: ultralyticsplus-0.0.17-py3-none-any.whl
- Upload date:
- Size: 11.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | dbc8d8eeb2bfa9623e5a91f836078f6ff34e5c6f4312291685e2eaa63b2949c5 |
|
MD5 | 6f095cbf93f6ba25afdfb211bc850feb |
|
BLAKE2b-256 | 87b5fb28a412953a9810d8d7a2f8ce48598c3793a43e06ebac6047fb354cf619 |