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 detection unit in which a plurality of elements for detecting an object are arranged; and a control unit configured to acquire a detection result from part of the plurality of elements and to determine whether a person is present in a detection range of the detection unit, and in a case where it is determined that a person is present in the detection range, to acquire a detection result from part of the plurality of elements of the detection unit and to determine whether to shift the image forming apparatus from the second power state to the first power state.