No need for AI or face recognition to do that: BT equipped system in elevator detects phones through their Bluetooth Device Address (sort of MAC address for BT), then calls a central repository of names to pair that phone with an identity, DNS style, then calls an advertising seller (for example, Google) that will happily give back the appropriate ads according to target, time, location and context.
Or, in a even more dystopian and much simpler scenario: some system app in the phone detects a beacon in the elevator through the above Device Address, then calls home (again, Google and others) and receives the ads to be shown in the elevator (or any other place with a audio/video system plus BT).
Custom audio and video advertising based on profiling and location
Looking at my spam folder what my world will look like then