Point, Segment and Count: A Generalized Framework for Object Counting