#ifndef INFERENCE_H #define INFERENCE_H #include #include #include #include struct Detection { float confidence; cv::Rect bbox; int class_id; std::string class_name; }; class InferenceEngine { public: InferenceEngine(const std::string &model_path); ~InferenceEngine(); std::vector preprocessImage(const cv::Mat &image); std::vector filterDetections(const std::vector &results, float confidence_threshold, int img_width, int img_height, int orig_width, int orig_height); std::vector runInference(const std::vector &input_tensor_values); cv::Mat draw_labels(const cv::Mat &image, const std::vector &detections); std::vector input_shape; private: Ort::Env env; Ort::SessionOptions session_options; Ort::Session session; std::string getInputName(); std::string getOutputName(); static const std::vector CLASS_NAMES; }; #endif // INFERENCE_H