Add compare function in ObjectDetector