mirror of
https://github.com/PaddlePaddle/FastDeploy.git
synced 2025-10-07 17:41:52 +08:00
[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:
@@ -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
|
||||
|
Reference in New Issue
Block a user