How do I get real time performance out of this CSRT object tracker?

Currently I’m getting less than 1fps using CSRT tracker on my Jetson Nano B01 with this code using opencv 4.10.0. 30 fps or more is what I’m shooting for. How can I change this code to improve the performance? I was getting 25-30 fps with this code on opencv 4.5.0. Could it be a version change that’s the difference? Or is there something I’m missing here?

void track_target(void)
{
/* Don't wrap the image from jetson inference until a valid image has been received.
   That way we know the memory has been allocaed and is ready. */
    if (valid_image_rcvd && !initialized_cv_image)
    {
        image_cv_wrapped = cv::Mat(input_video_height, input_video_width, CV_8UC3, image); // Directly wrap uchar3*
        initialized_cv_image = true;
    }
    else if (valid_image_rcvd && initialized_cv_image)
    {
        if (target_valid && !initialized_tracker)
        {
            target_bounding_box = cv::Rect(target_left, target_top, target_width, target_height);
            tracker_init(target_tracker, image_cv_wrapped, target_bounding_box);
            initialized_tracker = true;
        }

        if (initialized_tracker)
        {
            target_tracked = tracker_update(target_tracker, image_cv_wrapped, target_bounding_box);
        }

        if (target_tracked)
        {
            std::cout << "Tracking" << std::endl;
            cv::rectangle(image_cv_wrapped, target_bounding_box, cv::Scalar(255, 0, 0));

            tracking = true;
        }
        else
        {
            std::cout << "Not Tracking" << std::endl;
            initialized_tracker = false;
            tracking = false;
        }
    }
}