From 827fe6b15d949a8ad180900e8d4fc98f68843a79 Mon Sep 17 00:00:00 2001 From: Channingss Date: Mon, 3 Aug 2020 02:11:55 +0000 Subject: [PATCH] delete custom_layer can inherit directly --- .../op_mapper/paddle2onnx/opset10/opset.py | 20 ------------ .../opset10/paddle_custom_layer/box_coder.py | 22 ------------- .../paddle_custom_layer/im2sequence.py | 22 ------------- .../paddle_custom_layer/multiclass_nms.py | 32 ------------------- .../opset10/paddle_custom_layer/prior_box.py | 22 ------------- .../opset10/paddle_custom_layer/yolo_box.py | 22 ------------- .../op_mapper/paddle2onnx/opset11/opset.py | 12 ------- .../opset11/paddle_custom_layer/box_coder.py | 22 ------------- .../paddle_custom_layer/im2sequence.py | 22 ------------- .../opset11/paddle_custom_layer/prior_box.py | 22 ------------- 10 files changed, 218 deletions(-) delete mode 100644 x2paddle/op_mapper/paddle2onnx/opset10/paddle_custom_layer/box_coder.py delete mode 100644 x2paddle/op_mapper/paddle2onnx/opset10/paddle_custom_layer/im2sequence.py delete mode 100644 x2paddle/op_mapper/paddle2onnx/opset10/paddle_custom_layer/multiclass_nms.py delete mode 100644 x2paddle/op_mapper/paddle2onnx/opset10/paddle_custom_layer/prior_box.py delete mode 100644 x2paddle/op_mapper/paddle2onnx/opset10/paddle_custom_layer/yolo_box.py delete mode 100644 x2paddle/op_mapper/paddle2onnx/opset11/paddle_custom_layer/box_coder.py delete mode 100644 x2paddle/op_mapper/paddle2onnx/opset11/paddle_custom_layer/im2sequence.py delete mode 100644 x2paddle/op_mapper/paddle2onnx/opset11/paddle_custom_layer/prior_box.py diff --git a/x2paddle/op_mapper/paddle2onnx/opset10/opset.py b/x2paddle/op_mapper/paddle2onnx/opset10/opset.py index ad8a922..f3dfc69 100644 --- a/x2paddle/op_mapper/paddle2onnx/opset10/opset.py +++ b/x2paddle/op_mapper/paddle2onnx/opset10/opset.py @@ -47,23 +47,3 @@ class OpSet10(OpSet9): inputs=[op.input('Input')[0], starts_name, ends_name, axes_name], outputs=op.output('Out'), ) return [starts_node, ends_node, axes_node, node] - - def im2sequence(self, op, block): - from .paddle_custom_layer.im2sequence import im2sequence - return im2sequence(op, block) - - def yolo_box(self, op, block): - from .paddle_custom_layer.yolo_box import yolo_box - return yolo_box(op, block) - - def multiclass_nms(self, op, block): - from .paddle_custom_layer.multiclass_nms import multiclass_nms - return multiclass_nms(op, block) - - def box_coder(self, op, block): - from .paddle_custom_layer.box_coder import box_coder - return box_coder(op, block) - - def prior_box(self, op, block): - from .paddle_custom_layer.prior_box import prior_box - return prior_box(op, block) diff --git a/x2paddle/op_mapper/paddle2onnx/opset10/paddle_custom_layer/box_coder.py b/x2paddle/op_mapper/paddle2onnx/opset10/paddle_custom_layer/box_coder.py deleted file mode 100644 index 50c01db..0000000 --- a/x2paddle/op_mapper/paddle2onnx/opset10/paddle_custom_layer/box_coder.py +++ /dev/null @@ -1,22 +0,0 @@ -# Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License" -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import onnx -import numpy as np -from onnx import onnx_pb, helper -from x2paddle.op_mapper.paddle2onnx.opset9.paddle_custom_layer.box_coder import box_coder as box_coder9 - - -def box_coder(op, block): - return box_coder9(op, block) diff --git a/x2paddle/op_mapper/paddle2onnx/opset10/paddle_custom_layer/im2sequence.py b/x2paddle/op_mapper/paddle2onnx/opset10/paddle_custom_layer/im2sequence.py deleted file mode 100644 index 84144ca..0000000 --- a/x2paddle/op_mapper/paddle2onnx/opset10/paddle_custom_layer/im2sequence.py +++ /dev/null @@ -1,22 +0,0 @@ -# Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License" -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import onnx -import numpy as np -from onnx import onnx_pb, helper -from x2paddle.op_mapper.paddle2onnx.opset9.paddle_custom_layer.im2sequence import im2sequence as im2sequence9 - - -def im2sequence(op, block): - return im2sequence9(op, block) diff --git a/x2paddle/op_mapper/paddle2onnx/opset10/paddle_custom_layer/multiclass_nms.py b/x2paddle/op_mapper/paddle2onnx/opset10/paddle_custom_layer/multiclass_nms.py deleted file mode 100644 index ef57b76..0000000 --- a/x2paddle/op_mapper/paddle2onnx/opset10/paddle_custom_layer/multiclass_nms.py +++ /dev/null @@ -1,32 +0,0 @@ -# Copyright (c) 2019 PaddlePaddle Authors. All Rights Reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License" -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import math -import sys -import os -import numpy as np -import paddle.fluid.core as core -import paddle.fluid as fluid -import onnx -import warnings -from onnx import helper, onnx_pb -from x2paddle.op_mapper.paddle2onnx.opset9.paddle_custom_layer.multiclass_nms import multiclass_nms as multiclass_nms9 - - -def multiclass_nms(op, block): - """ - Convert the paddle multiclass_nms to onnx op. - This op is get the select boxes from origin boxes. - """ - return multiclass_nms9(op, block) diff --git a/x2paddle/op_mapper/paddle2onnx/opset10/paddle_custom_layer/prior_box.py b/x2paddle/op_mapper/paddle2onnx/opset10/paddle_custom_layer/prior_box.py deleted file mode 100644 index 76d301f..0000000 --- a/x2paddle/op_mapper/paddle2onnx/opset10/paddle_custom_layer/prior_box.py +++ /dev/null @@ -1,22 +0,0 @@ -# Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License" -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import onnx -import numpy as np -from onnx import onnx_pb, helper -from x2paddle.op_mapper.paddle2onnx.opset9.paddle_custom_layer.prior_box import prior_box as prior_box9 - - -def prior_box(op, block): - return prior_box9(op, block) diff --git a/x2paddle/op_mapper/paddle2onnx/opset10/paddle_custom_layer/yolo_box.py b/x2paddle/op_mapper/paddle2onnx/opset10/paddle_custom_layer/yolo_box.py deleted file mode 100644 index 563c5b1..0000000 --- a/x2paddle/op_mapper/paddle2onnx/opset10/paddle_custom_layer/yolo_box.py +++ /dev/null @@ -1,22 +0,0 @@ -# Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License" -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import onnx -import numpy as np -from onnx import onnx_pb, helper -from x2paddle.op_mapper.paddle2onnx.opset9.paddle_custom_layer.yolo_box import yolo_box as yolo_box9 - - -def yolo_box(op, block): - return yolo_box9(op, block) diff --git a/x2paddle/op_mapper/paddle2onnx/opset11/opset.py b/x2paddle/op_mapper/paddle2onnx/opset11/opset.py index d20ef86..15bd620 100644 --- a/x2paddle/op_mapper/paddle2onnx/opset11/opset.py +++ b/x2paddle/op_mapper/paddle2onnx/opset11/opset.py @@ -263,10 +263,6 @@ class OpSet11(OpSet10): node3 ] - def im2sequence(self, op, block): - from .paddle_custom_layer.im2sequence import im2sequence - return im2sequence(op, block) - def yolo_box(self, op, block): from .paddle_custom_layer.yolo_box import yolo_box return yolo_box(op, block) @@ -274,11 +270,3 @@ class OpSet11(OpSet10): def multiclass_nms(self, op, block): from .paddle_custom_layer.multiclass_nms import multiclass_nms return multiclass_nms(op, block) - - def box_coder(self, op, block): - from .paddle_custom_layer.box_coder import box_coder - return box_coder(op, block) - - def prior_box(self, op, block): - from .paddle_custom_layer.prior_box import prior_box - return prior_box(op, block) diff --git a/x2paddle/op_mapper/paddle2onnx/opset11/paddle_custom_layer/box_coder.py b/x2paddle/op_mapper/paddle2onnx/opset11/paddle_custom_layer/box_coder.py deleted file mode 100644 index 99bbdc7..0000000 --- a/x2paddle/op_mapper/paddle2onnx/opset11/paddle_custom_layer/box_coder.py +++ /dev/null @@ -1,22 +0,0 @@ -# Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License" -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import onnx -import numpy as np -from onnx import onnx_pb, helper -from x2paddle.op_mapper.paddle2onnx.opset10.paddle_custom_layer.box_coder import box_coder as box_coder10 - - -def box_coder(op, block): - return box_coder10(op, block) diff --git a/x2paddle/op_mapper/paddle2onnx/opset11/paddle_custom_layer/im2sequence.py b/x2paddle/op_mapper/paddle2onnx/opset11/paddle_custom_layer/im2sequence.py deleted file mode 100644 index be7aa34..0000000 --- a/x2paddle/op_mapper/paddle2onnx/opset11/paddle_custom_layer/im2sequence.py +++ /dev/null @@ -1,22 +0,0 @@ -# Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License" -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import onnx -import numpy as np -from onnx import onnx_pb, helper -from x2paddle.op_mapper.paddle2onnx.opset10.paddle_custom_layer.im2sequence import im2sequence as im2sequence10 - - -def im2sequence(op, block): - return im2sequence10(op, block) diff --git a/x2paddle/op_mapper/paddle2onnx/opset11/paddle_custom_layer/prior_box.py b/x2paddle/op_mapper/paddle2onnx/opset11/paddle_custom_layer/prior_box.py deleted file mode 100644 index 4e8aa28..0000000 --- a/x2paddle/op_mapper/paddle2onnx/opset11/paddle_custom_layer/prior_box.py +++ /dev/null @@ -1,22 +0,0 @@ -# Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License" -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import onnx -import numpy as np -from onnx import onnx_pb, helper -from x2paddle.op_mapper.paddle2onnx.opset10.paddle_custom_layer.prior_box import prior_box as prior_box10 - - -def prior_box(op, block): - return prior_box10(op, block) -- GitLab