-
Notifications
You must be signed in to change notification settings - Fork 118
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
PLT update, add Ocr model case (#2937)
* add plt export, test=model * add plt export, test=model * add plt export, test=model * add plt export, test=model * add plt export, test=model * add plt export, test=model * add plt export, test=model * add plt export, test=model * add plt export, test=model * add plt export, test=model * add plt export, test=model * add plt export, test=model * add plt export, test=model * add plt export, test=model * add plt export, test=model * fix plt start, test=model * fix plt start, test=model * fix plt start, test=model * fix plt start, test=model * fix plt perf, test=model * add plt bm ignore, test=model * update plt start.sh, test=model * update plt start.sh, test=model * add inputspec plt ci, test=model * add inputspec plt ci, test=model * update plt ci, test=model * update plt ci, test=model * update plt ci, test=model * update plt ci, test=model * update plt ci, test=model * update plt gsb, test=model * fix plt statistic, test=model * plt update net instance, test=model * plt update net instance, test=model * plt update net instance, test=model * plt update net instance, test=model * plt update net instance, test=model * plt update net instance, test=model * plt update net instance, test=model * plt update net instance, test=model * plt update net instance, test=model * plt update net instance, test=model * plt update net instance, test=model * plt update net instance, test=model * plt update net instance, test=model * plt update net instance, test=model * plt update net instance, test=model * plt update net instance, test=model * plt update net instance, test=model * plt update net instance, test=model * plt update net instance, test=model * plt update net instance, test=model * plt update net instance, test=model * plt update net instance, test=model * plt update net instance, test=model * plt update net instance, test=model * plt update net instance, test=model * plt update net instance, test=model * fix plt tools, test=model * update ply add model case, test=model * update ply add model case, test=model * update ply add model case, test=model
- Loading branch information
Showing
80 changed files
with
2,230 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
framework/e2e/PaddleLT_new/layerModelcase/Ocr_cases/__init__.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import os | ||
import glob | ||
|
||
# 获取当前文件所在目录 | ||
current_dir = os.path.dirname(__file__) | ||
|
||
# 获取当前目录下所有的文件夹路径(注意:这里不需要尾随的斜杠) | ||
folders = glob.glob(os.path.join(current_dir, '*')) | ||
|
||
# 过滤出文件夹(排除文件) | ||
folders = [folder for folder in folders if os.path.isdir(folder) and not os.path.basename(folder) == '__pycache__'] | ||
|
||
# 动态导入所有 .py 文件 | ||
for folder in folders: | ||
# 获取文件名(不含扩展名) | ||
module_name = os.path.basename(folder) | ||
# 导入模块 | ||
__import__('layerModelcase.Ocr_cases.' + module_name, globals(), locals(), []) |
15 changes: 15 additions & 0 deletions
15
framework/e2e/PaddleLT_new/layerModelcase/Ocr_cases/backbones/__init__.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import os | ||
import glob | ||
|
||
# 获取当前文件所在目录 | ||
current_dir = os.path.dirname(__file__) | ||
|
||
# 获取当前目录下所有的 .py 文件路径 | ||
py_files = glob.glob(os.path.join(current_dir, "*.py")) | ||
|
||
# 动态导入所有 .py 文件 | ||
for py_file in py_files: | ||
# 获取文件名(不含扩展名) | ||
module_name = os.path.basename(py_file)[:-3] | ||
# 导入模块 | ||
__import__('layerModelcase.Ocr_cases.backbones.' + module_name, globals(), locals(), []) |
30 changes: 30 additions & 0 deletions
30
framework/e2e/PaddleLT_new/layerModelcase/Ocr_cases/backbones/cls_DenseNet.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import paddle | ||
import numpy as np | ||
import PaddleOCR.ppocr.modeling.backbones as backbones | ||
|
||
|
||
def LayerCase(): | ||
"""模型库中间态""" | ||
model = backbones.build_backbone(config={"name": "DenseNet"}, model_type="cls") | ||
return model | ||
|
||
|
||
|
||
def create_inputspec(): | ||
inputspec = ( | ||
paddle.static.InputSpec(shape=(-1, 3, 224, 224), dtype=paddle.float32, stop_gradient=False), | ||
) | ||
return inputspec | ||
|
||
def create_tensor_inputs(): | ||
inputs = ( | ||
paddle.rand(shape=[1, 3, 224, 224], dtype=paddle.float32), | ||
) | ||
return inputs | ||
|
||
|
||
def create_numpy_inputs(): | ||
inputs = ( | ||
np.random.random(size=[1, 3, 224, 224]).astype('float32'), | ||
) | ||
return inputs |
30 changes: 30 additions & 0 deletions
30
framework/e2e/PaddleLT_new/layerModelcase/Ocr_cases/backbones/cls_EfficientNetb3_PREN.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import paddle | ||
import numpy as np | ||
import PaddleOCR.ppocr.modeling.backbones as backbones | ||
|
||
|
||
def LayerCase(): | ||
"""模型库中间态""" | ||
model = backbones.build_backbone(config={"name": "EfficientNetb3_PREN"}, model_type="cls") | ||
return model | ||
|
||
|
||
|
||
def create_inputspec(): | ||
inputspec = ( | ||
paddle.static.InputSpec(shape=(-1, 3, 224, 224), dtype=paddle.float32, stop_gradient=False), | ||
) | ||
return inputspec | ||
|
||
def create_tensor_inputs(): | ||
inputs = ( | ||
paddle.rand(shape=[1, 3, 224, 224], dtype=paddle.float32), | ||
) | ||
return inputs | ||
|
||
|
||
def create_numpy_inputs(): | ||
inputs = ( | ||
np.random.random(size=[1, 3, 224, 224]).astype('float32'), | ||
) | ||
return inputs |
30 changes: 30 additions & 0 deletions
30
framework/e2e/PaddleLT_new/layerModelcase/Ocr_cases/backbones/cls_HybridTransformer.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import paddle | ||
import numpy as np | ||
import PaddleOCR.ppocr.modeling.backbones as backbones | ||
|
||
|
||
def LayerCase(): | ||
"""模型库中间态""" | ||
model = backbones.build_backbone(config={"name": "HybridTransformer"}, model_type="cls") | ||
return model | ||
|
||
|
||
|
||
def create_inputspec(): | ||
inputspec = ( | ||
paddle.static.InputSpec(shape=(-1, 3, 224, 224), dtype=paddle.float32, stop_gradient=False), | ||
) | ||
return inputspec | ||
|
||
def create_tensor_inputs(): | ||
inputs = ( | ||
paddle.rand(shape=[1, 3, 224, 224], dtype=paddle.float32), | ||
) | ||
return inputs | ||
|
||
|
||
def create_numpy_inputs(): | ||
inputs = ( | ||
np.random.random(size=[1, 3, 224, 224]).astype('float32'), | ||
) | ||
return inputs |
30 changes: 30 additions & 0 deletions
30
framework/e2e/PaddleLT_new/layerModelcase/Ocr_cases/backbones/cls_MTB.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import paddle | ||
import numpy as np | ||
import PaddleOCR.ppocr.modeling.backbones as backbones | ||
|
||
|
||
def LayerCase(): | ||
"""模型库中间态""" | ||
model = backbones.build_backbone(config={"name": "MTB"}, model_type="cls") | ||
return model | ||
|
||
|
||
|
||
def create_inputspec(): | ||
inputspec = ( | ||
paddle.static.InputSpec(shape=(-1, 3, 224, 224), dtype=paddle.float32, stop_gradient=False), | ||
) | ||
return inputspec | ||
|
||
def create_tensor_inputs(): | ||
inputs = ( | ||
paddle.rand(shape=[1, 3, 224, 224], dtype=paddle.float32), | ||
) | ||
return inputs | ||
|
||
|
||
def create_numpy_inputs(): | ||
inputs = ( | ||
np.random.random(size=[1, 3, 224, 224]).astype('float32'), | ||
) | ||
return inputs |
30 changes: 30 additions & 0 deletions
30
framework/e2e/PaddleLT_new/layerModelcase/Ocr_cases/backbones/cls_MicroNet.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import paddle | ||
import numpy as np | ||
import PaddleOCR.ppocr.modeling.backbones as backbones | ||
|
||
|
||
def LayerCase(): | ||
"""模型库中间态""" | ||
model = backbones.build_backbone(config={"name": "MicroNet"}, model_type="cls") | ||
return model | ||
|
||
|
||
|
||
def create_inputspec(): | ||
inputspec = ( | ||
paddle.static.InputSpec(shape=(-1, 3, 224, 224), dtype=paddle.float32, stop_gradient=False), | ||
) | ||
return inputspec | ||
|
||
def create_tensor_inputs(): | ||
inputs = ( | ||
paddle.rand(shape=[1, 3, 224, 224], dtype=paddle.float32), | ||
) | ||
return inputs | ||
|
||
|
||
def create_numpy_inputs(): | ||
inputs = ( | ||
np.random.random(size=[1, 3, 224, 224]).astype('float32'), | ||
) | ||
return inputs |
30 changes: 30 additions & 0 deletions
30
framework/e2e/PaddleLT_new/layerModelcase/Ocr_cases/backbones/cls_MobileNetV1Enhance.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import paddle | ||
import numpy as np | ||
import PaddleOCR.ppocr.modeling.backbones as backbones | ||
|
||
|
||
def LayerCase(): | ||
"""模型库中间态""" | ||
model = backbones.build_backbone(config={"name": "MobileNetV3"}, model_type="cls") | ||
return model | ||
|
||
|
||
|
||
def create_inputspec(): | ||
inputspec = ( | ||
paddle.static.InputSpec(shape=(-1, 3, 224, 224), dtype=paddle.float32, stop_gradient=False), | ||
) | ||
return inputspec | ||
|
||
def create_tensor_inputs(): | ||
inputs = ( | ||
paddle.rand(shape=[1, 3, 224, 224], dtype=paddle.float32), | ||
) | ||
return inputs | ||
|
||
|
||
def create_numpy_inputs(): | ||
inputs = ( | ||
np.random.random(size=[1, 3, 224, 224]).astype('float32'), | ||
) | ||
return inputs |
30 changes: 30 additions & 0 deletions
30
framework/e2e/PaddleLT_new/layerModelcase/Ocr_cases/backbones/cls_MobileNetV3.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import paddle | ||
import numpy as np | ||
import PaddleOCR.ppocr.modeling.backbones as backbones | ||
|
||
|
||
def LayerCase(): | ||
"""模型库中间态""" | ||
model = backbones.build_backbone(config={"name": "MobileNetV3"}, model_type="cls") | ||
return model | ||
|
||
|
||
|
||
def create_inputspec(): | ||
inputspec = ( | ||
paddle.static.InputSpec(shape=(-1, 3, 224, 224), dtype=paddle.float32, stop_gradient=False), | ||
) | ||
return inputspec | ||
|
||
def create_tensor_inputs(): | ||
inputs = ( | ||
paddle.rand(shape=[1, 3, 224, 224], dtype=paddle.float32), | ||
) | ||
return inputs | ||
|
||
|
||
def create_numpy_inputs(): | ||
inputs = ( | ||
np.random.random(size=[1, 3, 224, 224]).astype('float32'), | ||
) | ||
return inputs |
30 changes: 30 additions & 0 deletions
30
framework/e2e/PaddleLT_new/layerModelcase/Ocr_cases/backbones/cls_PPHGNet_small.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import paddle | ||
import numpy as np | ||
import PaddleOCR.ppocr.modeling.backbones as backbones | ||
|
||
|
||
def LayerCase(): | ||
"""模型库中间态""" | ||
model = backbones.build_backbone(config={"name": "PPHGNet_small"}, model_type="cls") | ||
return model | ||
|
||
|
||
|
||
def create_inputspec(): | ||
inputspec = ( | ||
paddle.static.InputSpec(shape=(-1, 3, 224, 224), dtype=paddle.float32, stop_gradient=False), | ||
) | ||
return inputspec | ||
|
||
def create_tensor_inputs(): | ||
inputs = ( | ||
paddle.rand(shape=[1, 3, 224, 224], dtype=paddle.float32), | ||
) | ||
return inputs | ||
|
||
|
||
def create_numpy_inputs(): | ||
inputs = ( | ||
np.random.random(size=[1, 3, 224, 224]).astype('float32'), | ||
) | ||
return inputs |
30 changes: 30 additions & 0 deletions
30
framework/e2e/PaddleLT_new/layerModelcase/Ocr_cases/backbones/cls_PPLCNetV3.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import paddle | ||
import numpy as np | ||
import PaddleOCR.ppocr.modeling.backbones as backbones | ||
|
||
|
||
def LayerCase(): | ||
"""模型库中间态""" | ||
model = backbones.build_backbone(config={"name": "PPLCNetV3"}, model_type="cls") | ||
return model | ||
|
||
|
||
|
||
def create_inputspec(): | ||
inputspec = ( | ||
paddle.static.InputSpec(shape=(-1, 3, 224, 224), dtype=paddle.float32, stop_gradient=False), | ||
) | ||
return inputspec | ||
|
||
def create_tensor_inputs(): | ||
inputs = ( | ||
paddle.rand(shape=[1, 3, 224, 224], dtype=paddle.float32), | ||
) | ||
return inputs | ||
|
||
|
||
def create_numpy_inputs(): | ||
inputs = ( | ||
np.random.random(size=[1, 3, 224, 224]).astype('float32'), | ||
) | ||
return inputs |
30 changes: 30 additions & 0 deletions
30
framework/e2e/PaddleLT_new/layerModelcase/Ocr_cases/backbones/cls_RepSVTR.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import paddle | ||
import numpy as np | ||
import PaddleOCR.ppocr.modeling.backbones as backbones | ||
|
||
|
||
def LayerCase(): | ||
"""模型库中间态""" | ||
model = backbones.build_backbone(config={"name": "RepSVTR"}, model_type="cls") | ||
return model | ||
|
||
|
||
|
||
def create_inputspec(): | ||
inputspec = ( | ||
paddle.static.InputSpec(shape=(-1, 3, 224, 224), dtype=paddle.float32, stop_gradient=False), | ||
) | ||
return inputspec | ||
|
||
def create_tensor_inputs(): | ||
inputs = ( | ||
paddle.rand(shape=[1, 3, 224, 224], dtype=paddle.float32), | ||
) | ||
return inputs | ||
|
||
|
||
def create_numpy_inputs(): | ||
inputs = ( | ||
np.random.random(size=[1, 3, 224, 224]).astype('float32'), | ||
) | ||
return inputs |
30 changes: 30 additions & 0 deletions
30
framework/e2e/PaddleLT_new/layerModelcase/Ocr_cases/backbones/cls_ResNet.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import paddle | ||
import numpy as np | ||
import PaddleOCR.ppocr.modeling.backbones as backbones | ||
|
||
|
||
def LayerCase(): | ||
"""模型库中间态""" | ||
model = backbones.build_backbone(config={"name": "ResNet"}, model_type="cls") | ||
return model | ||
|
||
|
||
|
||
def create_inputspec(): | ||
inputspec = ( | ||
paddle.static.InputSpec(shape=(-1, 3, 224, 224), dtype=paddle.float32, stop_gradient=False), | ||
) | ||
return inputspec | ||
|
||
def create_tensor_inputs(): | ||
inputs = ( | ||
paddle.rand(shape=[1, 3, 224, 224], dtype=paddle.float32), | ||
) | ||
return inputs | ||
|
||
|
||
def create_numpy_inputs(): | ||
inputs = ( | ||
np.random.random(size=[1, 3, 224, 224]).astype('float32'), | ||
) | ||
return inputs |
Oops, something went wrong.