An image forming apparatus comprising: a user interface device; an image forming operation unit; a detection sensor having a two-dimensional array structure including a plurality of sensor columns (C1 - C8); a power supply to supply power to the user interface device and the image forming operation unit according to a plurality of power modes, the plurality of power modes including a sleep mode and a stand-by mode, in which the power supply is to supply more power in the stand-by mode than in the sleep mode; and a controller to, switch a power mode from the sleep mode to the stand-by mode, when a first condition is satisfied based on sensor data detected by the sensor columns (C1 - C8), the first condition being a condition in which results of calculations performed on data, of the sensor data, corresponding to a number of consecutive sensor columns (C1 - C8) among the plurality of sensor columns (C1 - C8), wherein each result corresponding to an average of detected values from sensors in a respective sensor column from the number of the consecutive sensor columns are each equal to or greater than a threshold value simultaneously for a period of time, to indicate detection of a human body, and control the power supply to supply power corresponding to the switched power mode to the user interface device and the image forming operation unit. a user interface device; an image forming operation unit; a detection sensor having a two-dimensional array structure including a plurality of sensor columns (C1 - C8); a power supply to supply power to the user interface device and the image forming operation unit according to a plurality of power modes, the plurality of power modes including a sleep mode and a stand-by mode, in which the power supply is to supply more power in the stand-by mode than in the sleep mode; and a controller to, switch a power mode from the sleep mode to the stand-by mode, when a first condition is satisfied based on sensor data detected by the sensor columns (C1 - C8), the first condition being a condition in which results of calculations performed on data, of the sensor data, corresponding to a number of consecutive sensor columns (C1 - C8) among the plurality of sensor columns (C1 - C8), wherein each result corresponding to an average of detected values from sensors in a respective sensor column from the number of the consecutive sensor columns are each equal to or greater than a threshold value simultaneously for a period of time, to indicate detection of a human body, and control the power supply to supply power corresponding to the switched power mode to the user interface device and the image forming operation unit. switch a power mode from the sleep mode to the stand-by mode, when a first condition is satisfied based on sensor data detected by the sensor columns (C1 - C8), the first condition being a condition in which results of calculations performed on data, of the sensor data, corresponding to a number of consecutive sensor columns (C1 - C8) among the plurality of sensor columns (C1 - C8), wherein each result corresponding to an average of detected values from sensors in a respective sensor column from the number of the consecutive sensor columns are each equal to or greater than a threshold value simultaneously for a period of time, to indicate detection of a human body, and control the power supply to supply power corresponding to the switched power mode to the user interface device and the image forming operation unit.