You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I’m working on a live inference project using DetectNet with a custom SSD-MobileNet model on a Jetson device. My goal is to perform object detection and display bounding boxes without showing the confidence score within the bounding boxes.
Here’s what I’ve done so far:
I’m using jetson-inference to load the model and detect objects.
I tried using OverlayText to label the detected objects, but it always shows the confidence score, which I don't need.
I also tried directly drawing bounding boxes without any text, but I still want to label the detected classes (like "helmet", "no_helmet", etc.) without the extra confidence information.
Here’s a simplified version of my code:
from jetson_inference import detectNet
from jetson_utils import videoSource, videoOutput
# Load the model
net = detectNet(model="model/ssd-mobilenet-300e.onnx", labels="model/labels.txt",
input_blob="input_0", output_cvg="scores", output_bbox="boxes",
threshold=0.5)
# Initialize video source and display
camera = videoSource("/dev/video0") # For real-time camera input
display = videoOutput("display://0") # For display output
while display.IsStreaming():
img = camera.Capture()
if img is None: # Capture timeout
continue
# Detect objects
detections = net.Detect(img)
# Reset counts for this frame
frame_counts = {
"helmet": 0,
"no_helmet": 0,
"vest": 0,
"no_vest": 0
}
# Count objects in the current frame
for detection in detections:
class_id = detection.ClassID
if class_id in class_labels:
label = class_labels[class_id]
frame_counts[label] += 1
display.Render(img)
display.SetStatus(f"Detection | FPS: {net.GetNetworkFPS()}")
I also tried to change output_cvg to "coverage" and an error just occured
[TRT] 3: Cannot find binding of given name: coverage
[TRT] failed to find requested output layer coverage in network
[TRT] device GPU, failed to create resources for CUDA engine
[TRT] failed to create TensorRT engine for model/ssd-mobilenet-300e.onnx, device GPU
[TRT] detectNet -- failed to initialize.
Could anyone guide me on how to:
Draw bounding boxes with just class labels (e.g., "helmet") without the confidence score?
Avoid using OverlayText if it forces confidence display or any alternative solution to this?
Any help or suggestions would be greatly appreciated!
Thanks in advance!
The text was updated successfully, but these errors were encountered:
Hi everyone,
I’m working on a live inference project using DetectNet with a custom SSD-MobileNet model on a Jetson device. My goal is to perform object detection and display bounding boxes without showing the confidence score within the bounding boxes.
Here’s what I’ve done so far:
OverlayText
to label the detected objects, but it always shows the confidence score, which I don't need.Here’s a simplified version of my code:
I also tried to change output_cvg to "coverage" and an error just occured
Could anyone guide me on how to:
Any help or suggestions would be greatly appreciated!
Thanks in advance!
The text was updated successfully, but these errors were encountered: