Files
FastDeploy/docs/api/vision_results/matting_result.md
DefTruth beddcba900 [docs][win] add windows c++ sdk demo to examples (#136)
* [docs] format docs with markdown with language tags

* [docs][win] add windows c++ sdk demo

* [docs][win] add windows c++ sdk demo to examples

* [docs][api] update runtime_option docs
2022-08-22 10:53:00 +08:00

1.8 KiB
Raw Blame History

MattingResult 抠图结果

MattingResult 代码定义在csrcs/fastdeploy/vision/common/result.h用于表明模型预测的alpha透明度的值预测的前景等。

C++ 定义

fastdeploy::vision::MattingResult

struct MattingResult {
  std::vector<float> alpha;
  std::vector<float> foreground;
  std::vector<int64_t> shape;
  bool contain_foreground = false;
  void Clear();
  std::string Str();
};
  • alpha: 是一维向量为预测的alpha透明度的值值域为[0.,1.]长度为hxwh,w为输入图像的高和宽
  • foreground: 是一维向量,为预测的前景,值域为[0.,255.]长度为hxwxch,w为输入图像的高和宽c一般为3foreground不是一定有的只有模型本身预测了前景这个属性才会有效
  • contain_foreground: 表示预测的结果是否包含前景
  • shape: 表示输出结果的shape当contain_foreground为falseshape只包含(h,w)当contain_foreground为trueshape包含(h,w,c), c一般为3
  • Clear(): 成员函数,用于清除结构体中存储的结果
  • Str(): 成员函数将结构体中的信息以字符串形式输出用于Debug

Python 定义

fastdeploy.vision.MattingResult

  • alpha(list of float): 是一维向量为预测的alpha透明度的值值域为[0.,1.]长度为hxwh,w为输入图像的高和宽
  • foreground(list of float): 是一维向量,为预测的前景,值域为[0.,255.]长度为hxwxch,w为输入图像的高和宽c一般为3foreground不是一定有的只有模型本身预测了前景这个属性才会有效
  • contain_foreground(bool): 表示预测的结果是否包含前景
  • shape(list of int): 表示输出结果的shape当contain_foreground为falseshape只包含(h,w)当contain_foreground为trueshape包含(h,w,c), c一般为3