An information processing apparatus detects an object that enters or exits a predetermined region, manages, in a queue, data based on the detection, and counts the number of predetermined object(s) based on an image obtained by capturing the predetermined region. The apparatus, in a case where the predetermined object is detected, the queue is corrected based on the number counted by and the number of data managed in the queue.
Information processing apparatus, method for controlling the same, and non-transitory computer-readable storage medium