Skip to content

Conversation

@wjj19950828
Copy link
Collaborator

@wjj19950828 wjj19950828 commented Nov 23, 2022

PR types(PR类型)

Model

Describe

  • remove Mattingresult.clear(), Prevent repeated resize
  • Add swap_rb param

环境:Mac CPU: Intel(R) Core(TM) i5-8257U CPU @ 1.40GHz

方式 Postprocess(ms)
result每次Clear() + Resize() 119.80
第一次result.Resize(), 后面复用第一次内存 2.75(第二次之后耗时)

wjj19950828 and others added 30 commits November 1, 2022 12:04
@wjj19950828 wjj19950828 marked this pull request as ready for review November 23, 2022 11:11
alpha.resize(size);
if (alpha.capacity() < size) {
alpha.resize(size);
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

resize会自动判断当前大小,来决定是否重新分配。所以可以删除if判断。

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

int c = static_cast<int>(shape[2]);
foreground.resize(size * c);
if (foreground.capacity() < size * c) {
foreground.resize(size * c);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

同上

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@jiangjiajun jiangjiajun merged commit 1da8c52 into PaddlePaddle:develop Nov 25, 2022
felixhjh pushed a commit to felixhjh/FastDeploy that referenced this pull request Dec 26, 2022
* add paddle_trt in benchmark

* update benchmark in device

* update benchmark

* update result doc

* fixed for CI

* update python api_docs

* update index.rst

* add runtime cpp examples

* deal with comments

* Update infer_paddle_tensorrt.py

* Add runtime quick start

* deal with comments

* fixed reused_input_tensors&&reused_output_tensors

* fixed docs

* fixed headpose typo

* fixed typo

* refactor yolov5

* update model infer

* refactor pybind for yolov5

* rm origin yolov5

* fixed bugs

* rm cuda preprocess

* fixed bugs

* fixed bugs

* fixed bug

* fixed bug

* fix pybind

* rm useless code

* add convert_and_permute

* fixed bugs

* fixed im_info for bs_predict

* fixed bug

* add bs_predict for yolov5

* Add runtime test and batch eval

* deal with comments

* fixed bug

* update testcase

* fixed batch eval bug

* fixed preprocess bug

* refactor yolov7

* add yolov7 testcase

* rm resize_after_load and add is_scale_up

* fixed bug

* set multi_label true

* optimize rvm preprocess

* optimizer rvm postprocess

* fixed bug

* deal with comments

Co-authored-by: Jason <928090362@qq.com>
Co-authored-by: Jason <jiangjiajun@baidu.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants