I encountered this error while trying to optimize object detection code run on a video. Code takes initial detections and then processes them to get bounding boxes and class ind