FastDeploy  latest
Fast & Easy to Deploy!
Public Member Functions | List of all members
fastdeploy::vision::detection::YOLOv5SegPreprocessor Class Reference

Preprocessor object for YOLOv5Seg serials model. More...

#include <preprocessor.h>

Public Member Functions

 YOLOv5SegPreprocessor ()
 Create a preprocessor instance for YOLOv5Seg serials model.
 
bool Run (std::vector< FDMat > *images, std::vector< FDTensor > *outputs, std::vector< std::map< std::string, std::array< float, 2 >>> *ims_info)
 Process the input image and prepare input tensors for runtime. More...
 
void SetSize (const std::vector< int > &size)
 Set target size, tuple of (width, height), default size = {640, 640}.
 
std::vector< int > GetSize () const
 Get target size, tuple of (width, height), default size = {640, 640}.
 
void SetPaddingValue (const std::vector< float > &padding_value)
 Set padding value, size should be the same as channels.
 
std::vector< float > GetPaddingValue () const
 Get padding value, size should be the same as channels.
 
void SetScaleUp (bool is_scale_up)
 
bool GetScaleUp () const
 Get is_scale_up, default true.
 
void SetMiniPad (bool is_mini_pad)
 
bool GetMiniPad () const
 Get is_mini_pad, default false.
 
void SetStride (int stride)
 Set padding stride, only for mini_pad mode.
 
bool GetStride () const
 Get padding stride, default 32.
 

Detailed Description

Preprocessor object for YOLOv5Seg serials model.

Member Function Documentation

◆ Run()

bool fastdeploy::vision::detection::YOLOv5SegPreprocessor::Run ( std::vector< FDMat > *  images,
std::vector< FDTensor > *  outputs,
std::vector< std::map< std::string, std::array< float, 2 >>> *  ims_info 
)

Process the input image and prepare input tensors for runtime.

Parameters
[in]imagesThe input image data list, all the elements are returned by cv::imread()
[in]outputsThe output tensors which will feed in runtime
[in]ims_infoThe shape info list, record input_shape and output_shape
Returns
true if the preprocess successed, otherwise false

◆ SetMiniPad()

void fastdeploy::vision::detection::YOLOv5SegPreprocessor::SetMiniPad ( bool  is_mini_pad)
inline

Set is_mini_pad, pad to the minimum rectange which height and width is times of stride

◆ SetScaleUp()

void fastdeploy::vision::detection::YOLOv5SegPreprocessor::SetScaleUp ( bool  is_scale_up)
inline

Set is_scale_up, if is_scale_up is false, the input image only can be zoom out, the maximum resize scale cannot exceed 1.0, default true


The documentation for this class was generated from the following files: