Vision Framework VNTrackObjectRequest: Minimum Valid Bounding Box Size Causing Internal Error (Code=9)

I'm developing a tennis ball tracking feature using Vision Framework in Swift, specifically utilizing VNDetectedObjectObservation and VNTrackObjectRequest.

Occasionally (but not always), I receive the following runtime error:

Failed to perform SequenceRequest: Error Domain=com.apple.Vision Code=9 "Internal error: unexpected tracked object bounding box size" UserInfo={NSLocalizedDescription=Internal error: unexpected tracked object bounding box size}

From my investigation, I suspect the issue arises when the bounding box from the initial observation (VNDetectedObjectObservation) is too small. However, Apple's documentation doesn't clearly define the minimum bounding box size that's considered valid by VNTrackObjectRequest.

Could someone clarify:

  • What is the minimum acceptable bounding box width and height (normalized) that Vision Framework's VNTrackObjectRequest expects?

  • Is there any recommended practice or official guidance for bounding box size validation before creating a tracking request?

This information would be extremely helpful to reliably avoid this internal error.

Thank you!

We are checking that the width * height of the bounding box to be tracked is bigger than FLT_MIN. So it looks like that your detected object has a zero width or height or at least very close to that.

Vision Framework VNTrackObjectRequest: Minimum Valid Bounding Box Size Causing Internal Error (Code=9)
 
 
Q