diff options
author | Michele Di Giorgio <michele.digiorgio@arm.com> | 2018-11-16 10:02:26 +0000 |
---|---|---|
committer | Michele Di Giorgio <michele.digiorgio@arm.com> | 2018-11-16 17:47:02 +0000 |
commit | c8df89f477c3dc63f396ad37bee8ed5d50dee4ac (patch) | |
tree | 4fc4151b382438416b531b3bcb586f88eb32c2d1 /tests/validation/CL/GenerateProposalsLayer.cpp | |
parent | a25d16c86f0d870408bc8b941aa755093417b0f0 (diff) | |
download | ComputeLibrary-c8df89f477c3dc63f396ad37bee8ed5d50dee4ac.tar.gz |
COMPMID-1451: (3RDPARTY_UPDATE) Fixes for GenerateProposals graph node and BoxWithNMSLimitKernel
COMPMID-1792: Accuracy issue in CLGenerateProposals
This patch does the following:
- Some fixes for GenerateProposals function and tests
- Adapting BoxWithNMSLimitKernel to only accept U32 tensors as keeps_size
- Update 3rdparty
- Adds a small tolerance for a GenerateProposals test
Change-Id: Ia8ec1cdfe941fe05003645e86deb9ea6a6044d74
Diffstat (limited to 'tests/validation/CL/GenerateProposalsLayer.cpp')
-rw-r--r-- | tests/validation/CL/GenerateProposalsLayer.cpp | 26 |
1 files changed, 17 insertions, 9 deletions
diff --git a/tests/validation/CL/GenerateProposalsLayer.cpp b/tests/validation/CL/GenerateProposalsLayer.cpp index 28cdc71ae6..b4772fcf79 100644 --- a/tests/validation/CL/GenerateProposalsLayer.cpp +++ b/tests/validation/CL/GenerateProposalsLayer.cpp @@ -68,38 +68,45 @@ DATA_TEST_CASE(Validate, framework::DatasetMode::ALL, zip(zip(zip(zip(zip(zip(zi TensorInfo(TensorShape(100U, 100U, 9U), 1, DataType::F16), // Mismatching types TensorInfo(TensorShape(100U, 100U, 9U), 1, DataType::F16), // Wrong deltas (number of transformation non multiple of 4) TensorInfo(TensorShape(100U, 100U, 9U), 1, DataType::F16), // Wrong anchors (number of values per roi != 5) - TensorInfo(TensorShape(100U, 100U, 9U), 1, DataType::F16)}), // Output tensor num_valid_proposals not scalar + TensorInfo(TensorShape(100U, 100U, 9U), 1, DataType::F16), // Output tensor num_valid_proposals not scalar + TensorInfo(TensorShape(100U, 100U, 9U), 1, DataType::F16)}), // num_valid_proposals not U32 framework::dataset::make("deltas",{ TensorInfo(TensorShape(100U, 100U, 36U), 1, DataType::F32), TensorInfo(TensorShape(100U, 100U, 36U), 1, DataType::F32), TensorInfo(TensorShape(100U, 100U, 38U), 1, DataType::F32), TensorInfo(TensorShape(100U, 100U, 38U), 1, DataType::F32), + TensorInfo(TensorShape(100U, 100U, 38U), 1, DataType::F32), TensorInfo(TensorShape(100U, 100U, 38U), 1, DataType::F32)})), framework::dataset::make("anchors", { TensorInfo(TensorShape(4U, 9U), 1, DataType::F32), TensorInfo(TensorShape(4U, 9U), 1, DataType::F32), TensorInfo(TensorShape(4U, 9U), 1, DataType::F32), TensorInfo(TensorShape(5U, 9U), 1, DataType::F32), + TensorInfo(TensorShape(4U, 9U), 1, DataType::F32), TensorInfo(TensorShape(4U, 9U), 1, DataType::F32)})), framework::dataset::make("proposals", { TensorInfo(TensorShape(5U, 100U*100U*9U), 1, DataType::F32), TensorInfo(TensorShape(5U, 100U*100U*9U), 1, DataType::F32), TensorInfo(TensorShape(5U, 100U*100U*9U), 1, DataType::F32), TensorInfo(TensorShape(5U, 100U*100U*9U), 1, DataType::F32), + TensorInfo(TensorShape(5U, 100U*100U*9U), 1, DataType::F32), TensorInfo(TensorShape(5U, 100U*100U*9U), 1, DataType::F32)})), framework::dataset::make("scores_out", { TensorInfo(TensorShape(100U*100U*9U), 1, DataType::F32), TensorInfo(TensorShape(100U*100U*9U), 1, DataType::F32), TensorInfo(TensorShape(100U*100U*9U), 1, DataType::F32), TensorInfo(TensorShape(100U*100U*9U), 1, DataType::F32), + TensorInfo(TensorShape(100U*100U*9U), 1, DataType::F32), TensorInfo(TensorShape(100U*100U*9U), 1, DataType::F32)})), framework::dataset::make("num_valid_proposals", { TensorInfo(TensorShape(1U, 1U), 1, DataType::U32), TensorInfo(TensorShape(1U, 1U), 1, DataType::U32), TensorInfo(TensorShape(1U, 1U), 1, DataType::U32), TensorInfo(TensorShape(1U, 1U), 1, DataType::U32), - TensorInfo(TensorShape(1U, 10U), 1, DataType::U32)})), + TensorInfo(TensorShape(1U, 10U), 1, DataType::U32), + TensorInfo(TensorShape(1U, 1U), 1, DataType::F16)})), framework::dataset::make("generate_proposals_info", { GenerateProposalsInfo(10.f, 10.f, 1.f), GenerateProposalsInfo(10.f, 10.f, 1.f), GenerateProposalsInfo(10.f, 10.f, 1.f), GenerateProposalsInfo(10.f, 10.f, 1.f), + GenerateProposalsInfo(10.f, 10.f, 1.f), GenerateProposalsInfo(10.f, 10.f, 1.f)})), - framework::dataset::make("Expected", { true, false, false, false, false })), + framework::dataset::make("Expected", { true, false, false, false, false, false })), scores, deltas, anchors, proposals, scores_out, num_valid_proposals, generate_proposals_info, expected) { ARM_COMPUTE_EXPECT(bool(CLGenerateProposalsLayer::validate(&scores.clone()->set_is_resizable(true), @@ -262,7 +269,7 @@ DATA_TEST_CASE(IntegrationTestCaseGenerateProposals, framework::DatasetMode::ALL CLTensor proposals; CLTensor num_valid_proposals; CLTensor scores_out; - num_valid_proposals.allocator()->init(TensorInfo(TensorShape(1), 1, DataType::F32)); + num_valid_proposals.allocator()->init(TensorInfo(TensorShape(1), 1, DataType::U32)); CLGenerateProposalsLayer generate_proposals; generate_proposals.configure(&scores, &bbox_deltas, &anchors, &proposals, &scores_out, &num_valid_proposals, @@ -286,26 +293,27 @@ DATA_TEST_CASE(IntegrationTestCaseGenerateProposals, framework::DatasetMode::ALL // Gather num_valid_proposals num_valid_proposals.map(); - const float N = *reinterpret_cast<float *>(num_valid_proposals.ptr_to_element(Coordinates(0, 0))); + const uint32_t N = *reinterpret_cast<uint32_t *>(num_valid_proposals.ptr_to_element(Coordinates(0, 0))); num_valid_proposals.unmap(); // Select the first N entries of the proposals CLTensor proposals_final; CLSlice select_proposals; - select_proposals.configure(&proposals, &proposals_final, Coordinates(0, 0), Coordinates(values_per_roi + 1, size_t(N))); + select_proposals.configure(&proposals, &proposals_final, Coordinates(0, 0), Coordinates(values_per_roi + 1, N)); proposals_final.allocator()->allocate(); select_proposals.run(); // Select the first N entries of the proposals CLTensor scores_final; CLSlice select_scores; - select_scores.configure(&scores_out, &scores_final, Coordinates(0), Coordinates(size_t(N))); + select_scores.configure(&scores_out, &scores_final, Coordinates(0), Coordinates(N)); scores_final.allocator()->allocate(); select_scores.run(); + const RelativeTolerance<float> tolerance_f32(1e-6f); // Validate the output - validate(CLAccessor(proposals_final), proposals_expected); - validate(CLAccessor(scores_final), scores_expected); + validate(CLAccessor(proposals_final), proposals_expected, tolerance_f32); + validate(CLAccessor(scores_final), scores_expected, tolerance_f32); } FIXTURE_DATA_TEST_CASE(ComputeAllAnchors, CLComputeAllAnchorsFixture<float>, framework::DatasetMode::ALL, |