mirror of
https://github.com/PaddlePaddle/FastDeploy.git
synced 2025-12-24 13:28:13 +08:00
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:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user