Implemented object detection.