It depends on the device you use. On the latest Apple models it uses LiDAR infrared grid to detect depth. On older Apple devices or Android it uses dual lenses and other augmented reality algorithms to detect depth. Combined, these methods can be used to look for people or people shaped objects.