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
|
|
@ -731,7 +731,7 @@ When using YOLO models in a multi-threaded application, it's important to instan
|
|||
from threading import Thread
|
||||
|
||||
def thread_safe_predict(image_path):
|
||||
# Instantiate a new model inside the thread
|
||||
"""Performs thread-safe prediction on an image using a locally instantiated YOLO model."""
|
||||
local_model = YOLO("yolov8n.pt")
|
||||
results = local_model.predict(image_path)
|
||||
# Process results
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue