Added the option to downsample the image before computing the detections