From d55a4e97ae9923b7d83286715af3ff73f5f82607 Mon Sep 17 00:00:00 2001 From: Thiago Crepaldi Date: Mon, 18 Jul 2022 16:13:05 -0400 Subject: [PATCH] Add unit test for PointRend ONNX export Refer to projects/PointRend/configs/InstanceSegmentation/pointrend_rcnn_R_50_FPN_3x_coco.yaml --- tests/test_export_onnx.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/tests/test_export_onnx.py b/tests/test_export_onnx.py index aa15e1a406..0931edf360 100644 --- a/tests/test_export_onnx.py +++ b/tests/test_export_onnx.py @@ -142,6 +142,19 @@ def gen_input(num1, num2): # support ONNX Runtime backend. assert has_dynamic_axes(onnx_model) + @skipIfUnsupportedMinOpsetVersion(16, STABLE_ONNX_OPSET_VERSION) + @skipIfUnsupportedMinTorchVersion("1.11.1") + def test_pointrend_rcnn_R_50_FPN_3x_coco(self): + def inference_func(model, image): + inputs = [{"image": image, "height": image.shape[1], "width": image.shape[2]}] + return model.inference(inputs, do_postprocess=True)[0]["instances"] + + self._test_model_from_config_path( + "projects/PointRend/configs/InstanceSegmentation/pointrend_rcnn_R_50_FPN_3x_coco.yaml", + inference_func, + opset_version=STABLE_ONNX_OPSET_VERSION, + ) + ################################################################################ # Testcase internals - DO NOT add tests below this point ################################################################################