mirror of
https://github.com/PaddlePaddle/FastDeploy.git
synced 2025-12-24 13:28:13 +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:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user