How to do detections in YOLOv5 only in a region of interest?

Viewed 760

I want to detect objects only in a specified region and ignore all the other detections outside the ROI. enter image description here

1 Answers

If I understand your question correctly, you want to detect objects which are present on the road surface.

One way to do that would be to first detect road surface (maybe by detecting lane markings: https://github.com/amusi/awesome-lane-detection) or using road free space detection models: https://github.com/fabvio/ld-lsi/) and then either feed only that part to your YOLOv5 to detect objects, or feed the complete image to it and later on filter your detected objects based on whether they are present on the road surface ( i.e. the bounding box of object overlaps with the road surface). If yes, you keep them otherwise ignore them.

Related