Earlier quoted context omitted.
Ah, but they are still spending time on you, being there in your face. If they truly weren't interested in you, then they'd leave in search of easier prey. Since your leaving could be spun as felony (in at least some jurisdictions) fleeing the police, you'd best not leave without their OK, explicit, or implicit by their leaving first. Note: don't let yourself get startled by the police into running away. One of the t…
They're checking everyone, and do not take well to anyone who questions their authority with "you have no reason to detain me, so I'll be going now."
Nowhere am I advocating that. I'm only suggesting "Am I free to leave?" and silence in response to anything but an unequivocal "Yes" to the question. And noting their leaving is also an implicit Yes.
Now, depending on your reading of the situation and the cop(s), you could play games with an equivocal answer, i.e. follow with "OK, you are detaining me", and if they object, go back to the free to leave theme, then press them on deciding one or the other. But that's not what I think one should generally do.