This is a simple script that counts the number of times an image is assigned to a particular category and its children category and assigns that count to an attribute. This can be useful if you want to find images with a specific group of people but not any others.
For example, to find images with Mom and Dad only, you might build a category with "Subject.People.Mom" AND "Subject.People.Dad". But this will also have images that contain other people in addition to Mom and Dad. After running this script, you can apply an attribute filter with Count.People = 2 to show images containing only Mom and Dad.
The attribute set and attributes must be created prior to running the script. The default categories and attributes can be changed by modifying the variable definitions in the script. The script will count assigned categories including child categories, but excluded alias, formula, and data-driven categories.
The script needs to be rerun on any image whose categorization is changed in a manner that affects the count.
It was inspired by khodadad's "Grouped People" script in IMatch 3.
[attachment deleted by admin]