My idea is:
a pair of sensors at each door of the bus, and these sensors will cover a stair planes each, one in the first and one in the last, when a person get on the bus the first sensor will detect the footprint shape to ensure that is a person and not some package or some other object, and increase the counter; when a person off the bus the second sensor will do the same and the counter will decrease.
Sensors also can detect the position of the person and the direction in walking (down or up) as to step our weight rests on the front so that the shape of the fingerprint sensor that detects the decrease in part contrary to walk.
to tell a person up and down both sensors must detect footsteps
-when a person first step on the sensor but not up to the bus, the counter does not increase equally when a person step on the second sensor down the bus but the counter does not diminish.