6#include <torch/torch.h>
8#include <opencv2/core/mat.hpp>
9#include <opencv2/core/types.hpp>
13 bool scale_up =
false);
14float letterbox(cv::Mat &input_image, cv::Mat &output_image,
15 const cv::Size &target_size);
16float cropbox(cv::Mat &input_image, cv::Mat &output_image,
17 const cv::Size &target_size);
21torch::Tensor
nms(
const torch::Tensor &bboxes,
const torch::Tensor &scores,
22 float iou_threshold = 0.45);
25 float confThreshold = 0.25,
26 float iouThreshold = 0.45,
27 int maxDetections = 300);
30[[deprecated(
"Use xyxy_to_xywh instead")]]
inline torch::Tensor
34[[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 xywh2xyxy(const torch::Tensor &x)
torch::Tensor nms(const torch::Tensor &bboxes, const torch::Tensor &scores, float iou_threshold=0.45)
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)