Skip to content

Commit

Permalink
[Other] Add MattingResult Free() (#705)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
wjj19950828 committed Nov 25, 2022
1 parent e012102 commit 86f05e9
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
7 changes: 7 additions & 0 deletions fastdeploy/vision/common/result.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
5 changes: 4 additions & 1 deletion fastdeploy/vision/common/result.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 86f05e9

Please sign in to comment.