Add new model PaddleSeg (#30)

* Support new model PaddleSeg

* Fix conflict

* PaddleSeg add visulization function

* fix bug

* Fix BindPPSeg wrong name

* Fix variable name

* Update by comments

* Add ppseg-unet example python version

Co-authored-by: Jason <jiangjiajun@baidu.com>
This commit is contained in:
huangjianhui
2022-07-21 15:38:21 +08:00
committed by GitHub
parent 8b0a0c6a10
commit a8458e6729
15 changed files with 453 additions and 8 deletions

View File

@@ -72,5 +72,27 @@ std::string DetectionResult::Str() {
return out;
}
void SegmentationResult::Clear() {
std::vector<std::vector<int64_t>>().swap(masks);
}
void SegmentationResult::Resize(int64_t height, int64_t width) {
masks.resize(height, std::vector<int64_t>(width));
}
std::string SegmentationResult::Str() {
std::string out;
out = "SegmentationResult Image masks 10 rows x 10 cols: \n";
for (size_t i = 0; i < 10; ++i) {
out += "[";
for (size_t j = 0; j < 10; ++j) {
out = out + std::to_string(masks[i][j]) + ", ";
}
out += ".....]\n";
}
out += "...........\n";
return out;
}
} // namespace vision
} // namespace fastdeploy

View File

@@ -56,5 +56,18 @@ struct FASTDEPLOY_DECL DetectionResult : public BaseResult {
std::string Str();
};
struct FASTDEPLOY_DECL SegmentationResult : public BaseResult {
// mask
std::vector<std::vector<int64_t>> masks;
ResultType type = ResultType::SEGMENTATION;
void Clear();
void Resize(int64_t height, int64_t width);
std::string Str();
};
} // namespace vision
} // namespace fastdeploy