Outputing Serial to Arduino to control Servos pwm #8086
Replies: 1 comment 1 reply
-
@synersignart 👋 Hello! Thanks for asking about handling inference results. YOLOv5 🚀 PyTorch Hub models allow for simple model loading and inference in a pure python environment without using Simple Inference ExampleThis example loads a pretrained YOLOv5s model from PyTorch Hub as import torch
# Model
model = torch.hub.load('ultralytics/yolov5', 'yolov5s') # yolov5n - yolov5x6 official model
# 'custom', 'path/to/best.pt') # custom model
# Images
im = 'https://ultralytics.com/images/zidane.jpg' # or file, Path, URL, PIL, OpenCV, numpy, list
# Inference
results = model(im)
# Results
results.print() # or .show(), .save(), .crop(), .pandas(), etc.
results.xyxy[0] # im predictions (tensor)
results.pandas().xyxy[0] # im predictions (pandas)
# xmin ymin xmax ymax confidence class name
# 0 749.50 43.50 1148.0 704.5 0.874023 0 person
# 2 114.75 195.75 1095.0 708.0 0.624512 0 person
# 3 986.00 304.00 1028.0 420.0 0.286865 27 tie See YOLOv5 PyTorch Hub Tutorial for details. Good luck 🍀 and let us know if you have any other questions! |
Beta Was this translation helpful? Give feedback.
-
in Detect.py
what would be the best way to implement Arduino serial to control servos?
how do I convert the data of the bounding boxes into PTZ servo control
the plan it to have yolo5v to lock on to the object selected then use the arduino to read the serial off python to drive servos
id wish some help into the codes as i dont know where to start
PS if a library and example can also be created for Processing.
Beta Was this translation helpful? Give feedback.
All reactions