1. A method comprising: receiving an image including a portion of a shelving unit; identifying a plurality of items in the image; determining a plurality of facings based on the plurality of items; determining whether items of adjacent facings in the plurality of facings are positioned within a threshold horizontal distance of each other, the threshold horizontal distance being based on a factor of a maximum dimension of the items in either of the adjacent facings; responsive to determining that the items of adjacent facings in the plurality of facings are positioned within the threshold distance of each other, grouping the plurality of facings based on position and identification; and determining a list of linear groups in the image.