Add docstrings and improve comments (#11229)
Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>
This commit is contained in:
parent
ccfc1cf925
commit
d5458f27cd
16 changed files with 34 additions and 17 deletions
|
|
@ -118,6 +118,7 @@ After creating the AWS CloudFormation Stack, the next step is to deploy YOLOv8.
|
|||
import json
|
||||
|
||||
def output_fn(prediction_output, content_type):
|
||||
"""Formats model outputs as JSON string according to content_type, extracting attributes like boxes, masks, keypoints."""
|
||||
print("Executing output_fn from inference.py ...")
|
||||
infer = {}
|
||||
for result in prediction_output:
|
||||
|
|
|
|||
|
|
@ -53,6 +53,7 @@ model = YOLO("yolov8n.pt")
|
|||
|
||||
|
||||
def predict_image(img, conf_threshold, iou_threshold):
|
||||
"""Predicts and plots labeled objects in an image using YOLOv8 model with adjustable confidence and IOU thresholds."""
|
||||
results = model.predict(
|
||||
source=img,
|
||||
conf=conf_threshold,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue