Skip to main content

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_predictions

# 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
img = 'https://github.com/ultralytics/yolov5/raw/master/data/images/zidane.jpg'

# perform inference
for result in model.predict(img, imgsz=640, return_outputs=True):
    print(result["det"]) # [[x1, y1, x2, y2, conf, class]]
    render = render_predictions(model, img=img, det=result["det"])
    render.show()

Project details


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.6.tar.gz (8.2 kB view hashes)

Uploaded Source

Built Distribution

ultralyticsplus-0.0.6-py3-none-any.whl (9.6 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page