The output_dict['detection_scores'] describes the confidence the model has in a specific prediction/region. In the script I provided you 10, a threshold can be passed using -t or --threshold. Only if the detection_scores of a detection is higher than the threshold, the image is being saved.