They could not count by weight (before ML)? For e.g - If 100 pearls weight 10 gm etc? They could also have used a machine for counting them
Even if only similar size pearls are allowed, small variations multiplied by a large amount of pearls can cause issues, such as distinguishing 100 pearls of 99 grams each from 99 pearls of 100 grams each.
Then they could have a simple optical/laser sensor below each hole to count how many smallest, smaller, small, medium, large, larger, and largest pearls fall through each hole.
The benefit would then be that if customers wanted pearls of a certain size, they are already sorted.
Maybe there is an enterprising user here that reads this, can easily create it, and reaches out to pearl companies.
Source: my distant family has a pearl farm and I implemented pricing algos.