yolov5
yolov5 copied to clipboard
Optimize object detection post processing?
Search before asking
- [X] I have searched the YOLOv5 issues and discussions and found no similar questions.
Question
I have trained Yolov5s model with default configuration on custom dataset. I got training accuracy really good. I am deploying it on EdgeTPU with input image size of 320. The models is fully compatible with EdgeTPU. The detection post process is running on CPU i.e. NMS and score conversion. The model output is 6300 detections. The edgtpu processing is runninf at 55 FPS but due to low CPU power post processing is a bottleneck situation in my case. Is there any possibility to reduce output bounding boxes without changing numbers of anchors? Is it possible to reduce/modify anchor grid in detection layer?
Additional
No response
@hardikdava yes you can reduce number of output anchors by reducing image size, reducing anchor count i.e. from 3 to 1, or eliminating output layers (i.e. P3, P4, P5), and retraining.
@glenn-jocher Thanks for quick reply. Is it possible toc= change grid size of detection layer? I think the bounding box will reduce by decreasing detection grid i.e. from (10,10) to (6,6) here .
@hardikdava grid strides are fixed at 8, 16, 32 etc.
@glenn-jocher I was able to run YoloV5s model with input image resolution of 288x288 pixels with 3 anchors at 75 fps by only considering top-k objects rather than all confident objects. Thanks for your quick replies.
@hardikdava great!