How to display a message when none of the object of interest is detected in given frame?

I am using yolo algo to detect objects of interest in a video. At times there are no objects for some time frame. At such times, I would like to display a message which reads “No object of interest”. I understand that detect.py should be tinkered with. How and where exactly should I do this ?