I want to detect objects only in a specified region and ignore all the other detections outside the ROI.
Asked
Active
Viewed 1,488 times
3

Subham Tiwari
- 450
- 4
- 14
1 Answers
1
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.

Rajat
- 647
- 3
- 10
- 30
-
can you give me a code sample where I have the road coordinates and now I want to crop the image out and feed it into the object detection model and get the predictions on that roi and ignore all others – Subham Tiwari Aug 19 '21 at 10:35
-
I updated the post with relevant github links. You can use road free space detection model to detect the extreme right and left pixels to draw the red box as shown in your image. – Rajat Aug 19 '21 at 10:42