[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

@@ -85,6 +85,19 @@ class PaddleClasModel(FastDeployModel):
model_format)
assert self.initialized, "PaddleClas model initialize failed."
def clone(self):
"""Clone PaddleClasModel object
:return: a new PaddleClasModel object
"""
class PaddleClasCloneModel(PaddleClasModel):
def __init__(self, model):
self._model = model
clone_model = PaddleClasCloneModel(self._model.clone())
return clone_model
def predict(self, im, topk=1):
"""Classify an input image