1. An image forming apparatus having a first power state and a second power state, which is lower in power consumption than the first power state, the image forming apparatus comprising: a sensor unit which includes a plurality of elements to detect a human; and a control unit configured to acquire a detection result from part of the plurality of elements and to determine whether a human is present in a detection range of the sensor unit based on the detection result from the part of the plurality of elements, and in a case where it is determined that a human is present in the detection range, to acquire a detection result from at least another part of the plurality of elements of the sensor unit and to determine whether to shift the image forming apparatus from the second power state to the first power state based on the detection result from at least another part of the plurality of elements.