mirror of
https://github.com/PaddlePaddle/FastDeploy.git
synced 2025-10-05 16:48:03 +08:00
[Model] Support PaddleYOLOv8 model (#1136)
This commit is contained in:
@@ -490,6 +490,31 @@ class PaddleYOLOv7(PPYOLOE):
|
||||
assert self.initialized, "PaddleYOLOv7 model initialize failed."
|
||||
|
||||
|
||||
class PaddleYOLOv8(PPYOLOE):
|
||||
def __init__(self,
|
||||
model_file,
|
||||
params_file,
|
||||
config_file,
|
||||
runtime_option=None,
|
||||
model_format=ModelFormat.PADDLE):
|
||||
"""Load a YOLOv8 model exported by PaddleDetection.
|
||||
|
||||
:param model_file: (str)Path of model file, e.g yolov8/model.pdmodel
|
||||
:param params_file: (str)Path of parameters file, e.g yolov8/model.pdiparams, if the model_fomat is ModelFormat.ONNX, this param will be ignored, can be set as empty string
|
||||
:param config_file: (str)Path of configuration file for deployment, e.g yolov8/infer_cfg.yml
|
||||
:param runtime_option: (fastdeploy.RuntimeOption)RuntimeOption for inference this model, if it's None, will use the default backend on CPU
|
||||
:param model_format: (fastdeploy.ModelForamt)Model format of the loaded model
|
||||
"""
|
||||
|
||||
super(PPYOLOE, self).__init__(runtime_option)
|
||||
|
||||
assert model_format == ModelFormat.PADDLE, "PaddleYOLOv8 model only support model format of ModelFormat.Paddle now."
|
||||
self._model = C.vision.detection.PaddleYOLOv8(
|
||||
model_file, params_file, config_file, self._runtime_option,
|
||||
model_format)
|
||||
assert self.initialized, "PaddleYOLOv8 model initialize failed."
|
||||
|
||||
|
||||
class RTMDet(PPYOLOE):
|
||||
def __init__(self,
|
||||
model_file,
|
||||
|
Reference in New Issue
Block a user