Open JustChenk opened 2 weeks ago
Hello! 👋
To utilize the tracking feature with a model loaded through AutoBackend
, you can switch to using the YOLO
class directly, as demonstrated in your second code snippet. The YOLO
class integrates seamlessly with YOLO's tracking capabilities, enabling you to perform object tracking with any supported model, including those exported to TensorRT. Here's how you can adapt the tracking code snippet:
from ultralytics import YOLO
def person_infer(weight_path):
# Load your model
model = YOLO(weight_path)
def process(frame):
# Use the track method here
results = model.track(frame, verbose=False, conf=0.5)
return results
return process
Just replace weight_path
with your model's path, and ensure your environment is set up for TensorRT if you are using a TensorRT model. This approach gives you access to the tracking functionality directly.
Feel free to reach out if you have any more questions! 😊
Search before asking
Question
I want to use the track method, but it doesn't have in AutoBackend
How can the track method be called, just like the code below `def person_infer(weight_path): model = YOLO(weight_path)
Additional
No response