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_model_output
# 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
for result in model.predict(image, imgsz=640, return_outputs=True):
print(result["det"]) # [[x1, y1, x2, y2, conf, class]]
render = render_model_output(model=model, image=image, model_output=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.9.tar.gz
(9.5 kB
view hashes)
Built Distribution
Close
Hashes for ultralyticsplus-0.0.9-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 126bddd4cb5ffcd869b734f291433424b120246f32b3a4ae5fcb2d5b7f1fe7d8 |
|
MD5 | ade3dc6640413b17336f1e578ca7693b |
|
BLAKE2b-256 | a55454f6f6f66093c611eabfe7b1169651a8b8c559ed35709da73d111151a184 |