mirror of
https://github.com/PaddlePaddle/FastDeploy.git
synced 2025-10-06 00:57:33 +08:00
[Model] Add is_mini_pad and stride for YOLOv5 python (#949)
* add onnx_ort_runtime demo * rm in requirements * support batch eval * fixed MattingResults bug * move assignment for DetectionResult * integrated x2paddle * add model convert readme * update readme * re-lint * add processor api * Add MattingResult Free * change valid_cpu_backends order * add ppocr benchmark * mv bs from 64 to 32 * fixed quantize.md * fixed quantize bugs * Add Monitor for benchmark * update mem monitor * Set trt_max_batch_size default 1 * fixed ocr benchmark bug * support yolov5 in serving * Fixed yolov5 serving * Fixed postprocess * update yolov5 to 7.0 * add poros runtime demos * update readme * Support poros abi=1 * rm useless note * deal with comments * support pp_trt for ppseg * fixed symlink problem * Add is_mini_pad and stride for yolov5 Co-authored-by: Jason <jiangjiajun@baidu.com>
This commit is contained in:
@@ -61,6 +61,23 @@ class FASTDEPLOY_DECL YOLOv5Preprocessor {
|
||||
/// Get is_scale_up, default true
|
||||
bool GetScaleUp() const { return is_scale_up_; }
|
||||
|
||||
/// Set is_mini_pad, pad to the minimum rectange
|
||||
/// which height and width is times of stride
|
||||
void SetMiniPad(bool is_mini_pad) {
|
||||
is_mini_pad_ = is_mini_pad;
|
||||
}
|
||||
|
||||
/// Get is_mini_pad, default false
|
||||
bool GetMiniPad() const { return is_mini_pad_; }
|
||||
|
||||
/// Set padding stride, only for mini_pad mode
|
||||
void SetStride(int stride) {
|
||||
stride_ = stride;
|
||||
}
|
||||
|
||||
/// Get padding stride, default 32
|
||||
bool GetStride() const { return stride_; }
|
||||
|
||||
protected:
|
||||
bool Preprocess(FDMat* mat, FDTensor* output,
|
||||
std::map<std::string, std::array<float, 2>>* im_info);
|
||||
|
Reference in New Issue
Block a user