Rename fastdeploy_runtime.h to runtime.h and Frontend to ModelFormat (#263)

rename frontend to model_format
This commit is contained in:
Jason
2022-09-22 13:24:05 +08:00
committed by GitHub
parent 9bebdaa915
commit e227c5625e
126 changed files with 400 additions and 380 deletions

View File

@@ -14,7 +14,7 @@
from __future__ import absolute_import
import logging
from .... import FastDeployModel, Frontend
from .... import FastDeployModel, ModelFormat
from .... import c_lib_wrap as C
@@ -23,7 +23,7 @@ class NanoDetPlus(FastDeployModel):
model_file,
params_file="",
runtime_option=None,
model_format=Frontend.ONNX):
model_format=ModelFormat.ONNX):
# 调用基函数进行backend_option的初始化
# 初始化后的option保存在self._runtime_option
super(NanoDetPlus, self).__init__(runtime_option)

View File

@@ -14,7 +14,7 @@
from __future__ import absolute_import
import logging
from .... import FastDeployModel, Frontend
from .... import FastDeployModel, ModelFormat
from .... import c_lib_wrap as C
@@ -23,7 +23,7 @@ class ScaledYOLOv4(FastDeployModel):
model_file,
params_file="",
runtime_option=None,
model_format=Frontend.ONNX):
model_format=ModelFormat.ONNX):
# 调用基函数进行backend_option的初始化
# 初始化后的option保存在self._runtime_option
super(ScaledYOLOv4, self).__init__(runtime_option)
@@ -92,21 +92,19 @@ class ScaledYOLOv4(FastDeployModel):
@is_mini_pad.setter
def is_mini_pad(self, value):
assert isinstance(
value,
bool), "The value to set `is_mini_pad` must be type of bool."
value, bool), "The value to set `is_mini_pad` must be type of bool."
self._model.is_mini_pad = value
@is_scale_up.setter
def is_scale_up(self, value):
assert isinstance(
value,
bool), "The value to set `is_scale_up` must be type of bool."
value, bool), "The value to set `is_scale_up` must be type of bool."
self._model.is_scale_up = value
@stride.setter
def stride(self, value):
assert isinstance(
value, int), "The value to set `stride` must be type of int."
assert isinstance(value,
int), "The value to set `stride` must be type of int."
self._model.stride = value
@max_wh.setter

View File

@@ -14,7 +14,7 @@
from __future__ import absolute_import
import logging
from .... import FastDeployModel, Frontend
from .... import FastDeployModel, ModelFormat
from .... import c_lib_wrap as C
@@ -23,7 +23,7 @@ class YOLOR(FastDeployModel):
model_file,
params_file="",
runtime_option=None,
model_format=Frontend.ONNX):
model_format=ModelFormat.ONNX):
# 调用基函数进行backend_option的初始化
# 初始化后的option保存在self._runtime_option
super(YOLOR, self).__init__(runtime_option)
@@ -92,21 +92,19 @@ class YOLOR(FastDeployModel):
@is_mini_pad.setter
def is_mini_pad(self, value):
assert isinstance(
value,
bool), "The value to set `is_mini_pad` must be type of bool."
value, bool), "The value to set `is_mini_pad` must be type of bool."
self._model.is_mini_pad = value
@is_scale_up.setter
def is_scale_up(self, value):
assert isinstance(
value,
bool), "The value to set `is_scale_up` must be type of bool."
value, bool), "The value to set `is_scale_up` must be type of bool."
self._model.is_scale_up = value
@stride.setter
def stride(self, value):
assert isinstance(
value, int), "The value to set `stride` must be type of int."
assert isinstance(value,
int), "The value to set `stride` must be type of int."
self._model.stride = value
@max_wh.setter

View File

@@ -14,7 +14,7 @@
from __future__ import absolute_import
import logging
from .... import FastDeployModel, Frontend
from .... import FastDeployModel, ModelFormat
from .... import c_lib_wrap as C
@@ -23,7 +23,7 @@ class YOLOv5(FastDeployModel):
model_file,
params_file="",
runtime_option=None,
model_format=Frontend.ONNX):
model_format=ModelFormat.ONNX):
# 调用基函数进行backend_option的初始化
# 初始化后的option保存在self._runtime_option
super(YOLOv5, self).__init__(runtime_option)
@@ -121,21 +121,19 @@ class YOLOv5(FastDeployModel):
@is_mini_pad.setter
def is_mini_pad(self, value):
assert isinstance(
value,
bool), "The value to set `is_mini_pad` must be type of bool."
value, bool), "The value to set `is_mini_pad` must be type of bool."
self._model.is_mini_pad = value
@is_scale_up.setter
def is_scale_up(self, value):
assert isinstance(
value,
bool), "The value to set `is_scale_up` must be type of bool."
value, bool), "The value to set `is_scale_up` must be type of bool."
self._model.is_scale_up = value
@stride.setter
def stride(self, value):
assert isinstance(
value, int), "The value to set `stride` must be type of int."
assert isinstance(value,
int), "The value to set `stride` must be type of int."
self._model.stride = value
@max_wh.setter
@@ -147,6 +145,5 @@ class YOLOv5(FastDeployModel):
@multi_label.setter
def multi_label(self, value):
assert isinstance(
value,
bool), "The value to set `multi_label` must be type of bool."
value, bool), "The value to set `multi_label` must be type of bool."
self._model.multi_label = value

View File

@@ -14,7 +14,7 @@
from __future__ import absolute_import
import logging
from .... import FastDeployModel, Frontend
from .... import FastDeployModel, ModelFormat
from .... import c_lib_wrap as C
@@ -23,7 +23,7 @@ class YOLOv5Lite(FastDeployModel):
model_file,
params_file="",
runtime_option=None,
model_format=Frontend.ONNX):
model_format=ModelFormat.ONNX):
# 调用基函数进行backend_option的初始化
# 初始化后的option保存在self._runtime_option
super(YOLOv5Lite, self).__init__(runtime_option)
@@ -100,21 +100,19 @@ class YOLOv5Lite(FastDeployModel):
@is_mini_pad.setter
def is_mini_pad(self, value):
assert isinstance(
value,
bool), "The value to set `is_mini_pad` must be type of bool."
value, bool), "The value to set `is_mini_pad` must be type of bool."
self._model.is_mini_pad = value
@is_scale_up.setter
def is_scale_up(self, value):
assert isinstance(
value,
bool), "The value to set `is_scale_up` must be type of bool."
value, bool), "The value to set `is_scale_up` must be type of bool."
self._model.is_scale_up = value
@stride.setter
def stride(self, value):
assert isinstance(
value, int), "The value to set `stride` must be type of int."
assert isinstance(value,
int), "The value to set `stride` must be type of int."
self._model.stride = value
@max_wh.setter

View File

@@ -14,7 +14,7 @@
from __future__ import absolute_import
import logging
from .... import FastDeployModel, Frontend
from .... import FastDeployModel, ModelFormat
from .... import c_lib_wrap as C
@@ -23,7 +23,7 @@ class YOLOv6(FastDeployModel):
model_file,
params_file="",
runtime_option=None,
model_format=Frontend.ONNX):
model_format=ModelFormat.ONNX):
# 调用基函数进行backend_option的初始化
# 初始化后的option保存在self._runtime_option
super(YOLOv6, self).__init__(runtime_option)
@@ -92,21 +92,19 @@ class YOLOv6(FastDeployModel):
@is_mini_pad.setter
def is_mini_pad(self, value):
assert isinstance(
value,
bool), "The value to set `is_mini_pad` must be type of bool."
value, bool), "The value to set `is_mini_pad` must be type of bool."
self._model.is_mini_pad = value
@is_scale_up.setter
def is_scale_up(self, value):
assert isinstance(
value,
bool), "The value to set `is_scale_up` must be type of bool."
value, bool), "The value to set `is_scale_up` must be type of bool."
self._model.is_scale_up = value
@stride.setter
def stride(self, value):
assert isinstance(
value, int), "The value to set `stride` must be type of int."
assert isinstance(value,
int), "The value to set `stride` must be type of int."
self._model.stride = value
@max_wh.setter

View File

@@ -14,7 +14,7 @@
from __future__ import absolute_import
import logging
from .... import FastDeployModel, Frontend
from .... import FastDeployModel, ModelFormat
from .... import c_lib_wrap as C
@@ -23,7 +23,7 @@ class YOLOv7(FastDeployModel):
model_file,
params_file="",
runtime_option=None,
model_format=Frontend.ONNX):
model_format=ModelFormat.ONNX):
# 调用基函数进行backend_option的初始化
# 初始化后的option保存在self._runtime_option
super(YOLOv7, self).__init__(runtime_option)
@@ -92,21 +92,19 @@ class YOLOv7(FastDeployModel):
@is_mini_pad.setter
def is_mini_pad(self, value):
assert isinstance(
value,
bool), "The value to set `is_mini_pad` must be type of bool."
value, bool), "The value to set `is_mini_pad` must be type of bool."
self._model.is_mini_pad = value
@is_scale_up.setter
def is_scale_up(self, value):
assert isinstance(
value,
bool), "The value to set `is_scale_up` must be type of bool."
value, bool), "The value to set `is_scale_up` must be type of bool."
self._model.is_scale_up = value
@stride.setter
def stride(self, value):
assert isinstance(
value, int), "The value to set `stride` must be type of int."
assert isinstance(value,
int), "The value to set `stride` must be type of int."
self._model.stride = value
@max_wh.setter

View File

@@ -14,7 +14,7 @@
from __future__ import absolute_import
import logging
from .... import FastDeployModel, Frontend
from .... import FastDeployModel, ModelFormat
from .... import c_lib_wrap as C
@@ -23,7 +23,7 @@ class YOLOv7End2EndORT(FastDeployModel):
model_file,
params_file="",
runtime_option=None,
model_format=Frontend.ONNX):
model_format=ModelFormat.ONNX):
# 调用基函数进行backend_option的初始化
# 初始化后的option保存在self._runtime_option
super(YOLOv7End2EndORT, self).__init__(runtime_option)
@@ -87,19 +87,17 @@ class YOLOv7End2EndORT(FastDeployModel):
@is_mini_pad.setter
def is_mini_pad(self, value):
assert isinstance(
value,
bool), "The value to set `is_mini_pad` must be type of bool."
value, bool), "The value to set `is_mini_pad` must be type of bool."
self._model.is_mini_pad = value
@is_scale_up.setter
def is_scale_up(self, value):
assert isinstance(
value,
bool), "The value to set `is_scale_up` must be type of bool."
value, bool), "The value to set `is_scale_up` must be type of bool."
self._model.is_scale_up = value
@stride.setter
def stride(self, value):
assert isinstance(
value, int), "The value to set `stride` must be type of int."
assert isinstance(value,
int), "The value to set `stride` must be type of int."
self._model.stride = value

View File

@@ -14,7 +14,7 @@
from __future__ import absolute_import
import logging
from .... import FastDeployModel, Frontend
from .... import FastDeployModel, ModelFormat
from .... import c_lib_wrap as C
@@ -23,7 +23,7 @@ class YOLOv7End2EndTRT(FastDeployModel):
model_file,
params_file="",
runtime_option=None,
model_format=Frontend.ONNX):
model_format=ModelFormat.ONNX):
# 调用基函数进行backend_option的初始化
# 初始化后的option保存在self._runtime_option
super(YOLOv7End2EndTRT, self).__init__(runtime_option)
@@ -87,19 +87,17 @@ class YOLOv7End2EndTRT(FastDeployModel):
@is_mini_pad.setter
def is_mini_pad(self, value):
assert isinstance(
value,
bool), "The value to set `is_mini_pad` must be type of bool."
value, bool), "The value to set `is_mini_pad` must be type of bool."
self._model.is_mini_pad = value
@is_scale_up.setter
def is_scale_up(self, value):
assert isinstance(
value,
bool), "The value to set `is_scale_up` must be type of bool."
value, bool), "The value to set `is_scale_up` must be type of bool."
self._model.is_scale_up = value
@stride.setter
def stride(self, value):
assert isinstance(
value, int), "The value to set `stride` must be type of int."
assert isinstance(value,
int), "The value to set `stride` must be type of int."
self._model.stride = value

View File

@@ -14,7 +14,7 @@
from __future__ import absolute_import
import logging
from .... import FastDeployModel, Frontend
from .... import FastDeployModel, ModelFormat
from .... import c_lib_wrap as C
@@ -23,7 +23,7 @@ class YOLOX(FastDeployModel):
model_file,
params_file="",
runtime_option=None,
model_format=Frontend.ONNX):
model_format=ModelFormat.ONNX):
# 调用基函数进行backend_option的初始化
# 初始化后的option保存在self._runtime_option
super(YOLOX, self).__init__(runtime_option)

View File

@@ -14,7 +14,7 @@
from __future__ import absolute_import
import logging
from .... import FastDeployModel, Frontend
from .... import FastDeployModel, ModelFormat
from .... import c_lib_wrap as C
@@ -24,10 +24,10 @@ class PPYOLOE(FastDeployModel):
params_file,
config_file,
runtime_option=None,
model_format=Frontend.PADDLE):
model_format=ModelFormat.PADDLE):
super(PPYOLOE, self).__init__(runtime_option)
assert model_format == Frontend.PADDLE, "PPYOLOE model only support model format of Frontend.Paddle now."
assert model_format == ModelFormat.PADDLE, "PPYOLOE model only support model format of ModelFormat.Paddle now."
self._model = C.vision.detection.PPYOLOE(
model_file, params_file, config_file, self._runtime_option,
model_format)
@@ -44,10 +44,10 @@ class PPYOLO(PPYOLOE):
params_file,
config_file,
runtime_option=None,
model_format=Frontend.PADDLE):
model_format=ModelFormat.PADDLE):
super(PPYOLOE, self).__init__(runtime_option)
assert model_format == Frontend.PADDLE, "PPYOLO model only support model format of Frontend.Paddle now."
assert model_format == ModelFormat.PADDLE, "PPYOLO model only support model format of ModelFormat.Paddle now."
self._model = C.vision.detection.PPYOLO(
model_file, params_file, config_file, self._runtime_option,
model_format)
@@ -60,10 +60,10 @@ class PPYOLOv2(PPYOLOE):
params_file,
config_file,
runtime_option=None,
model_format=Frontend.PADDLE):
model_format=ModelFormat.PADDLE):
super(PPYOLOE, self).__init__(runtime_option)
assert model_format == Frontend.PADDLE, "PPYOLOv2 model only support model format of Frontend.Paddle now."
assert model_format == ModelFormat.PADDLE, "PPYOLOv2 model only support model format of ModelFormat.Paddle now."
self._model = C.vision.detection.PPYOLOv2(
model_file, params_file, config_file, self._runtime_option,
model_format)
@@ -76,10 +76,10 @@ class PaddleYOLOX(PPYOLOE):
params_file,
config_file,
runtime_option=None,
model_format=Frontend.PADDLE):
model_format=ModelFormat.PADDLE):
super(PPYOLOE, self).__init__(runtime_option)
assert model_format == Frontend.PADDLE, "PaddleYOLOX model only support model format of Frontend.Paddle now."
assert model_format == ModelFormat.PADDLE, "PaddleYOLOX model only support model format of ModelFormat.Paddle now."
self._model = C.vision.detection.PaddleYOLOX(
model_file, params_file, config_file, self._runtime_option,
model_format)
@@ -92,10 +92,10 @@ class PicoDet(PPYOLOE):
params_file,
config_file,
runtime_option=None,
model_format=Frontend.PADDLE):
model_format=ModelFormat.PADDLE):
super(PPYOLOE, self).__init__(runtime_option)
assert model_format == Frontend.PADDLE, "PicoDet model only support model format of Frontend.Paddle now."
assert model_format == ModelFormat.PADDLE, "PicoDet model only support model format of ModelFormat.Paddle now."
self._model = C.vision.detection.PicoDet(
model_file, params_file, config_file, self._runtime_option,
model_format)
@@ -108,10 +108,10 @@ class FasterRCNN(PPYOLOE):
params_file,
config_file,
runtime_option=None,
model_format=Frontend.PADDLE):
model_format=ModelFormat.PADDLE):
super(PPYOLOE, self).__init__(runtime_option)
assert model_format == Frontend.PADDLE, "FasterRCNN model only support model format of Frontend.Paddle now."
assert model_format == ModelFormat.PADDLE, "FasterRCNN model only support model format of ModelFormat.Paddle now."
self._model = C.vision.detection.FasterRCNN(
model_file, params_file, config_file, self._runtime_option,
model_format)
@@ -124,10 +124,10 @@ class YOLOv3(PPYOLOE):
params_file,
config_file,
runtime_option=None,
model_format=Frontend.PADDLE):
model_format=ModelFormat.PADDLE):
super(PPYOLOE, self).__init__(runtime_option)
assert model_format == Frontend.PADDLE, "YOLOv3 model only support model format of Frontend.Paddle now."
assert model_format == ModelFormat.PADDLE, "YOLOv3 model only support model format of ModelFormat.Paddle now."
self._model = C.vision.detection.YOLOv3(
model_file, params_file, config_file, self._runtime_option,
model_format)
@@ -140,10 +140,10 @@ class MaskRCNN(FastDeployModel):
params_file,
config_file,
runtime_option=None,
model_format=Frontend.PADDLE):
model_format=ModelFormat.PADDLE):
super(MaskRCNN, self).__init__(runtime_option)
assert model_format == Frontend.PADDLE, "MaskRCNN model only support model format of Frontend.Paddle now."
assert model_format == ModelFormat.PADDLE, "MaskRCNN model only support model format of ModelFormat.Paddle now."
self._model = C.vision.detection.MaskRCNN(
model_file, params_file, config_file, self._runtime_option,
model_format)