[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
This commit is contained in:
WJJ1995
2022-11-25 18:30:35 +08:00
committed by GitHub
parent e012102e1d
commit 86f05e9ac8
2 changed files with 11 additions and 1 deletions

View File

@@ -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<float>().swap(alpha);
std::vector<float>().swap(foreground);
std::vector<int64_t>().swap(shape);

View File

@@ -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);