Skip to content

Commit 86f05e9

Browse files
authored
[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
1 parent e012102 commit 86f05e9

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

fastdeploy/vision/common/result.cc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -378,6 +378,13 @@ MattingResult::MattingResult(const MattingResult& res) {
378378
}
379379

380380
void MattingResult::Clear() {
381+
alpha.clear();
382+
foreground.clear();
383+
shape.clear();
384+
contain_foreground = false;
385+
}
386+
387+
void MattingResult::Free() {
381388
std::vector<float>().swap(alpha);
382389
std::vector<float>().swap(foreground);
383390
std::vector<int64_t>().swap(shape);

fastdeploy/vision/common/result.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -316,9 +316,12 @@ struct FASTDEPLOY_DECL MattingResult : public BaseResult {
316316

317317
MattingResult() {}
318318
MattingResult(const MattingResult& res);
319-
/// Clear detection result
319+
/// Clear matting result
320320
void Clear();
321321

322+
/// Free matting result
323+
void Free();
324+
322325
void Reserve(int size);
323326

324327
void Resize(int size);

0 commit comments

Comments
 (0)