7#include <torch/torch.h>
9#include <opencv2/core/mat.hpp>
10#include <opencv2/core/types.hpp>
14 bool scale_up =
false);
15float letterbox(cv::Mat &input_image, cv::Mat &output_image,
16 const cv::Size &target_size);
17float cropbox(cv::Mat &input_image, cv::Mat &output_image,
18 const cv::Size &target_size);
22torch::Tensor
nms(
const torch::Tensor &bboces,
const torch::Tensor &scores,
23 float iou_threshold = 0.45);
26 float confThreshold = 0.25,
27 float iouThreshold = 0.45,
28 int maxDetections = 300);
31[[deprecated(
"Use xyxy_to_xywh instead")]]
inline torch::Tensor
35[[deprecated(
"Use xywh_to_xyxy instead")]]
inline torch::Tensor
float letterbox(cv::Mat &input_image, cv::Mat &output_image, const cv::Size &target_size)
torch::Tensor nms(const torch::Tensor &bboces, const torch::Tensor &scores, float iou_threshold=0.45)
torch::Tensor xywh2xyxy(const torch::Tensor &x)
float cropbox(cv::Mat &input_image, cv::Mat &output_image, const cv::Size &target_size)
torch::Tensor xywh_to_xyxy(const torch::Tensor &x)
float generate_scale(cv::Mat &image, const cv::Size &target_size, bool scale_up=false)
torch::Tensor xyxy2xywh(const torch::Tensor &x)
torch::Tensor non_max_suppression(torch::Tensor &predictions, float confThreshold=0.25, float iouThreshold=0.45, int maxDetections=300)
torch::Tensor xyxy_to_xywh(const torch::Tensor &x)