1. A people counting device comprising: a processor; and a memory storing instructions that, when executed by the processor, cause the processor to perform operations including: inputting an image; extracting a person from the image; creating a motion path of the person from positional information in the image of the person extracted; counting a number of people based on a positional relation between the motion path of the person and a measurement reference coordinate set within the image; obtaining at least one attribute of the person; and setting the measurement reference coordinate for the motion path corresponding to the person according to the at least one attribute of the person, wherein the at least one attribute extracted is an age of the person, when the age is determined to be one of lower than a first predetermined age and higher than a second predetermined age, the processor sets the measurement reference coordinate at a lower position in the image, with respect to a standing state of the person in the image, than a position set when the age is determined to be one of the first predetermined age, the second predetermined age, and an age between the first predetermined age and the second predetermined age, and the second predetermined age is greater than the first predetermined age.