From 86f05e9ac862a2364fbd4b9a8f5fb70bf9726ae6 Mon Sep 17 00:00:00 2001 From: WJJ1995 Date: Fri, 25 Nov 2022 18:30:35 +0800 Subject: [PATCH] [Other] Add MattingResult Free() (#705) * 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 --- fastdeploy/vision/common/result.cc | 7 +++++++ fastdeploy/vision/common/result.h | 5 ++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/fastdeploy/vision/common/result.cc b/fastdeploy/vision/common/result.cc index ee13760489..0211720bed 100755 --- a/fastdeploy/vision/common/result.cc +++ b/fastdeploy/vision/common/result.cc @@ -378,6 +378,13 @@ MattingResult::MattingResult(const MattingResult& res) { } void MattingResult::Clear() { + alpha.clear(); + foreground.clear(); + shape.clear(); + contain_foreground = false; +} + +void MattingResult::Free() { std::vector().swap(alpha); std::vector().swap(foreground); std::vector().swap(shape); diff --git a/fastdeploy/vision/common/result.h b/fastdeploy/vision/common/result.h index 27f6a97709..2fd3d72dd9 100755 --- a/fastdeploy/vision/common/result.h +++ b/fastdeploy/vision/common/result.h @@ -316,9 +316,12 @@ struct FASTDEPLOY_DECL MattingResult : public BaseResult { MattingResult() {} MattingResult(const MattingResult& res); - /// Clear detection result + /// Clear matting result void Clear(); + /// Free matting result + void Free(); + void Reserve(int size); void Resize(int size);