You just can't make that distinction with people, especially not if just using IR or the likes. The guy with a rifle slung over his shoulder just happens to look like the guy with carrying a rake. Hand gun in hand happens to look the same as a power drill. Someone wearing a beanie looks suspiciously like a soldier with a helmet.
This all feels like a really bad idea.
One should not use it on attack, when people need to distinguish between a soldier and a civilian.
But on a defence, when you need to keep a certain area empty from enemies (and there is nobody else but enemies incoming), then it resembles the usage of mines, only better (both in terms of efficiency and safety/callback/disarm).
Another scenario or cutting the logistics. If you know that a road is only used by military, then letting the automatic drones watch and engage is a great idea.