I have created a model on my computer, export it to onnx model and run it on the jetson inference docker, it then successfully output the image classification label to me, but I am confused on how to result the classified label to an output as I need send the output label to my arduino board.
Hi,
You can find the output in the returned predictions
variables.
Then you can send it via some message broker libraries.
while True:
# capture the next image
img = input.Capture()
if img is None: # timeout
continue
# classify the image and get the topK predictions
# if you only want the top class, you can simply run:
# class_id, confidence = net.Classify(img)
predictions = net.Classify(img, topK=args.topK)
# draw predicted class labels
for n, (classID, confidence) in enumerate(predictions):
classLabel = net.GetClassLabel(classID)
confidence *= 100.0
print(f"imagenet: {confidence:05.2f}% class #{classID} ({classLabel})")
font.OverlayText(img, text=f"{confidence:05.2f}% {classLabel}",
x=5, y=5 + n * (font.GetSize() + 5),
Thanks.
system
Closed
January 29, 2025, 5:10am
5
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.