Learning a Metacognition for Object Detection