Optimizing YOLOv8 for Real-Time Object Detection in a Specific Screen Area

I’m working on real-time object detection using YOLOv8, but I only need to detect objects in approximately 40% of the screen area. Is it possible to limit the captureOut method to focus solely on that specific region of the screen?

If this isn’t feasible, I’m considering an approach where the full-screen pixel buffer is captured and then cropped to the target area before running detection. However, I’m concerned about how this might affect real-time performance.

I’d appreciate any insights on how to maintain real-time performance or suggestions for better alternatives. Thank you!

Answered by DTS Engineer in 810151022

Hello @keisan1231,

If you are using Vision's CoreMLRequest to handle prediction using your model, set its regionOfInterest to the normalized region you are interested in.

Best regards,

Greg

Hi there. Are you using AVCaptureMetadataOutput for detection or using AVCaptureVideoDataOutput? The former has a -rectOfInterest property that limits the detection area and can improve performance. The metadata output does have a general object detector, called "salient objects". Try that out, and see if it solves your problem.

Hello @keisan1231,

If you are using Vision's CoreMLRequest to handle prediction using your model, set its regionOfInterest to the normalized region you are interested in.

Best regards,

Greg

Optimizing YOLOv8 for Real-Time Object Detection in a Specific Screen Area
 
 
Q