An image forming apparatus, comprising: a first detection portion including a pyroelectric sensor and adapted to detect an upper half of a human body; a first signal generation portion adapted to receive an output of the pyroelectric sensor of the first detection portion to generate a first signal whose level varies according to whether or not an output value of the pyroelectric sensor of the first detection portion is greater than a prescribed threshold value; a second detection portion including a pyroelectric sensor and adapted to detect a lower area than the first detection portion to detect a lower half of the human body; a second signal generation portion adapted to receive an output of the pyroelectric sensor of the second detection portion to generate a second signal whose level varies according to whether or not an output value of the pyroelectric sensor of the second detection portion is greater than a prescribed threshold value; a storage portion for storing discrimination data including data defining, with respect to variation patterns, frequencies and duty factors of the first and second signals (S1, S2), a condition for recognizing a human moving toward the image forming apparatus and a condition for recognizing a human crossing a detection area of the pyroelectric sensors (71a, 72a); and a recognition portion adapted to recognize a direction of movement of a human with respect to the image forming apparatus by recognizing, based on the variation patterns, frequencies and duty factors of the first and second signals (S1, S2) and the discrimination data, whether a human is moving toward the image forming apparatus and whether a human is crossing the detection area of the pyroelectric sensors (71a, 72a). a first detection portion including a pyroelectric sensor and adapted to detect an upper half of a human body; a first signal generation portion adapted to receive an output of the pyroelectric sensor of the first detection portion to generate a first signal whose level varies according to whether or not an output value of the pyroelectric sensor of the first detection portion is greater than a prescribed threshold value; a second detection portion including a pyroelectric sensor and adapted to detect a lower area than the first detection portion to detect a lower half of the human body; a second signal generation portion adapted to receive an output of the pyroelectric sensor of the second detection portion to generate a second signal whose level varies according to whether or not an output value of the pyroelectric sensor of the second detection portion is greater than a prescribed threshold value; a storage portion for storing discrimination data including data defining, with respect to variation patterns, frequencies and duty factors of the first and second signals (S1, S2), a condition for recognizing a human moving toward the image forming apparatus and a condition for recognizing a human crossing a detection area of the pyroelectric sensors (71a, 72a); and a recognition portion adapted to recognize a direction of movement of a human with respect to the image forming apparatus by recognizing, based on the variation patterns, frequencies and duty factors of the first and second signals (S1, S2) and the discrimination data, whether a human is moving toward the image forming apparatus and whether a human is crossing the detection area of the pyroelectric sensors (71a, 72a).