I want to conditional branch by the size of the bounding box with the demo code of jetson-inference

I have a question about jetson-infrence object detection.
Using the demo code, you can get the ClassID, Left, Top, Right, Bottom, Width, Height, Area, center of Bounding Box on the terminal.

import jetson.inference
import jetson.utils
net = jetson.inference.detectNet(“ssd-inception-v2”, threshold=0.5)
camera = jetson.utils.videoSource("/dev/video0", 1280, 720)
display = jetson.utils.videoOutput()
while display.IsStreaming():
img = camera.Capture()
detections = net.Detect(img, 1280, 720,“box, labels, conf”)
for i in detections:
display.SetStatus(“Object Detection | Network {:.0f} FPS”.format(net.GetNetworkFPS()))

I would like to use the Area value, for example, to make the small BoundingBox unrecognizable.
Where should the Area value come from in this case?
Please help me!!

Hi @kazuki.yumiba, the area of the bounding box is it’swidth * height. To get the area, you can simply use detection.area. Or in the case of your for loop:

for i in detections:
   area = i.area
   print('area', area)
1 Like

Thank you for your reply.
It worked fine thanks to you.