11#include " yolox_cpp/yolox_openvino.hpp"
22
33namespace yolox_cpp {
4- YoloXOpenVINO::YoloXOpenVINO (file_name_t path_to_model, std::string device_name,
5- float nms_th, float conf_th, std::string model_version,
4+ YoloXOpenVINO::YoloXOpenVINO (const file_name_t & path_to_model, std::string device_name,
5+ float nms_th, float conf_th, const std::string & model_version,
66 int num_classes, bool p6)
77 :AbcYoloX(nms_th, conf_th, model_version, num_classes, p6),
88 device_name_ (device_name)
@@ -69,14 +69,16 @@ namespace yolox_cpp{
6969 ov::Tensor{ov::element::f32 , this ->input_shape_ , reinterpret_cast <float *>(this ->blob_ .data ())});
7070 infer_request_.infer ();
7171
72-
7372 const auto &output_tensor = this ->infer_request_ .get_output_tensor ();
7473 const float * net_pred = reinterpret_cast <float *>(output_tensor.data ());
7574
76- float scale = std::min (input_w_ / (frame.cols *1.0 ), input_h_ / (frame.rows *1.0 ));
75+ const float scale = std::min (
76+ static_cast <float >(this ->input_w_ ) / static_cast <float >(frame.cols ),
77+ static_cast <float >(this ->input_h_ ) / static_cast <float >(frame.rows )
78+ );
79+
7780 std::vector<Object> objects;
7881 decode_outputs (net_pred, this ->grid_strides_ , objects, this ->bbox_conf_thresh_ , scale, frame.cols , frame.rows );
7982 return objects;
8083 }
81-
82- }
84+ }
0 commit comments