Hierarchical detection of persons in groups