#ifndef YOLO_CROWD_HPP #define YOLO_CROWD_HPP #include "trt_tensor.hpp" #include "object_detector.hpp" #include #include #include #include #include namespace YoloCrowd { using namespace std; using namespace ObjectDetector; enum class Type : int { V5 = 0, X = 1, V3 = 2, V7 = 3 }; enum class NMSMethod : int { CPU = 0, // General, for estimate mAP FastGPU = 1 // Fast NMS with a small loss of accuracy in corner cases }; void image_to_tensor(const cv::Mat &image, shared_ptr &tensor, Type type, int ibatch); class Infer { public: virtual shared_future commit(const cv::Mat &image) = 0; virtual std::vector> commits(const std::vector &images) = 0; }; shared_ptr create_infer( const string &engine_file, Type type, int gpuid, float confidence_threshold = 0.25f, float nms_threshold = 0.5f, NMSMethod nms_method = NMSMethod::FastGPU, int max_objects = 1024, bool use_multi_preprocess_stream = false); const char *type_name(Type type); }; // namespace YoloCrowd #endif // YOLO_CROWD_HPP