Give it a photo.
A model finds the hard hats. A rule decides. This one learned from 277 openly licensed photos, 226 with hard hats and the rest with helmets, buckets and boxes that are not, so it is a small model doing an honest job. The tutorial shows how one is trained.
Or try one of these
Can you catch it out? Find a photo with a hard hat it misses. When it is not sure, the rule sends the photo to a person.
Your photo is sent to Sight to be checked. Do not use a photo that is private or shows people who would mind. Privacy
The photo and its verdict appear here.
Sample photos from Open Images, each licensed CC BY 2.0: U.S. Army Corps of Engineers; U.S. Department of Agriculture; Metropolitan Transportation Authority of the State of New York.