[Other] Add Model Clone function for PaddleClas && PaddleDet && PaddleSeg (#791)

* Refactor PaddleSeg with preprocessor && postprocessor

* Fix bugs

* Delete redundancy code

* Modify by comments

* Refactor according to comments

* Add batch evaluation

* Add single test script

* Add ppliteseg single test script && fix eval(raise) error

* fix bug

* Fix evaluation segmentation.py batch predict

* Fix segmentation evaluation bug

* Fix evaluation segmentation bugs

* Update segmentation result docs

* Update old predict api and DisableNormalizeAndPermute

* Update resize segmentation label map with cv::INTER_NEAREST

* Add Model Clone function for PaddleClas && PaddleDet && PaddleSeg

* Add multi thread demo

* Add python model clone function

* Add multi thread python && C++ example

* Fix bug

Co-authored-by: Jason <jiangjiajun@baidu.com>
This commit is contained in:
huangjianhui
2022-12-13 15:19:47 +08:00
committed by GitHub
parent 6a1a3d001f
commit 9937b6c325
15 changed files with 455 additions and 3 deletions

View File

@@ -57,6 +57,19 @@ class PaddleSegModel(FastDeployModel):
"""
return self._model.batch_predict(image_list)
def clone(self):
"""Clone PaddleSegModel object
:return: a new PaddleSegModel object
"""
class PaddleSegCloneModel(PaddleSegModel):
def __init__(self, model):
self._model = model
clone_model = PaddleSegCloneModel(self._model.clone())
return clone_model
@property
def preprocessor(self):
"""Get PaddleSegPreprocessor object of the loaded model