Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proposal reference implementation #3924

Merged
merged 49 commits into from
Feb 8, 2021
Merged
Show file tree
Hide file tree
Changes from 12 commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
cb6ceed
Reference implementation for Proposal, enable CPU SLT
Jan 19, 2021
d98a329
code style fix
Jan 19, 2021
ce991be
add type prop test for invalid anchor count
Jan 19, 2021
3ff0e9f
add unit test
Jan 19, 2021
2e54584
fix shapes in attribute test
Jan 20, 2021
f57d31e
temp workaround- disable maring end of boxes list
Jan 20, 2021
bef307f
Disable CPU smoke test- spec misalignment
Jan 21, 2021
149bfcb
code style fixes
Jan 21, 2021
7d95847
add some details to the specification
Jan 21, 2021
ba9eb9c
disable myriadx proposal slt
Jan 21, 2021
b873a5b
Merge branch 'master' into proposal_ref_impl
Jan 21, 2021
78ed690
review changes, using usigned int and size_t
Jan 22, 2021
092a086
improve proposal op shape inference to cover dynamic too, add unit te…
Jan 25, 2021
00ead6c
remove unused variable in test body
Jan 25, 2021
7b7ed66
remove batch size in tests where its not used
Jan 25, 2021
ca899f3
add post nms topn initialization in tests where it was missing
Jan 25, 2021
bcacc89
review comments
Jan 26, 2021
3eb2437
style fix
Jan 26, 2021
efd0e00
style fix 2
Jan 26, 2021
8c683e7
add tests, remove unused variables, change shape inference checks
Jan 26, 2021
56faf9d
style fix
Jan 26, 2021
7abf14c
add input tensors type checks and test coverage
Jan 26, 2021
0b2250e
align input type in attribute and ngraphreader tests to match specifi…
Jan 26, 2021
d6d4289
fix wrong dimension in error message
Jan 26, 2021
5714d5e
proposalv4 ref impl
Jan 26, 2021
08790e5
enable single layer and unit tests for proposalv4 ref impl
Jan 26, 2021
0d8f538
align output termination with cpu, enable cpu slt
Jan 27, 2021
7344e96
custom slt compares to detect less-than-predicted number of boxes
Jan 27, 2021
92a8f37
custom slt compares to detect less-than-predicted number of boxes
Jan 27, 2021
d699ea1
Clarify output termination in spec
Jan 27, 2021
6b3b3f2
review comments
Jan 27, 2021
28cc91e
smaller input data for unit tests
Jan 28, 2021
d733ec8
add check for batch_dim being static
Jan 28, 2021
b420ab4
disable gpu slt for proposal
Jan 28, 2021
dd7fe02
Merge branch 'master' into proposal_ref_impl
Jan 28, 2021
b0748e8
test data style fix
Jan 28, 2021
6158290
Merge branch 'proposal_ref_impl' of https://github.com/blesniewski/op…
Jan 28, 2021
6f8ea19
test data style fix 2
Jan 28, 2021
208d606
add type section to specification
Feb 1, 2021
859c81a
shape inference improvement
Feb 2, 2021
992b6b0
Merge remote-tracking branch 'upstream/master' into proposal_ref_impl
Feb 2, 2021
cdc7ba1
multiply expected 1st dim in tests by post_nms_topn
Feb 3, 2021
cdbab54
add checks and testcases for dynamic ranks
Feb 3, 2021
0998b1f
indentation, review comments
Feb 3, 2021
d2a3604
reduce code redundancy in ref implementation
Feb 3, 2021
286b45b
remove comment
Feb 3, 2021
6369920
Fix typo in proposal1 spec
Feb 5, 2021
93e9121
Fix typo in proposal4 spec
Feb 5, 2021
3c6a508
Merge remote-tracking branch 'upstream/master' into proposal_ref_impl
Feb 7, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions docs/ops/detection/Proposal_1.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

**Detailed description**

*Proposal* has three inputs: a tensor with probabilities whether particular bounding box corresponds to background and foreground, a tensor with bbox_deltas for each of the bounding boxes, a tensor with input image size in the [`image_height`, `image_width`, `scale_height_and_width`] or [`image_height`, `image_width`, `scale_height`, `scale_width`] format. The produced tensor has two dimensions `[batch_size * post_nms_topn, 5]`.
*Proposal* has three inputs: a tensor with probabilities whether particular bounding box corresponds to background and foreground, a tensor with bbox_deltas for each of the bounding boxes, a tensor with input image size in the [`image_height`, `image_width`, `scale_height_and_width`] or [`image_height`, `image_width`, `scale_height`, `scale_width`] format. The produced tensor has two dimensions `[batch_size * post_nms_topn, 5]`, and for each output box contains batch index and box coordinates.
*Proposal* layer does the following with the input tensor:
blesniewski marked this conversation as resolved.
Show resolved Hide resolved
1. Generates initial anchor boxes. Left top corner of all boxes is at (0, 0). Width and height of boxes are calculated from *base_size* with *scale* and *ratio* attributes.
2. For each point in the first input tensor:
Expand Down Expand Up @@ -136,9 +136,9 @@

**Inputs**:

* **1**: 4D input floating point tensor with class prediction scores. Required.
* **1**: 4D input floating point tensor with class prediction scores of shape `[batch_size, 2*K, H, W]`. Required.

* **2**: 4D input floating point tensor with box bbox_deltas. Required.
* **2**: 4D input floating point tensor with box bbox_deltas of shape `[batch_size, 4*K, H, W]`. Required.

* **3**: 1D input floating tensor 3 or 4 elements: [`image_height`, `image_width`, `scale_height_and_width`] or [`image_height`, `image_width`, `scale_height`, `scale_width`]. Required.

blesniewski marked this conversation as resolved.
Show resolved Hide resolved
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,4 @@ INSTANTIATE_TEST_CASE_P(smoke_Proposal_tests, ProposalLayerTest,
::testing::Values(CommonTestUtils::DEVICE_CPU)),
ProposalLayerTest::getTestCaseName
);

} // namespace
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ std::vector<std::string> disabledTestPatterns() {
R"(.*decomposition1_batch=5_hidden_size=10_input_size=30_.*tanh.relu.*_clip=0_linear_before_reset=1.*_targetDevice=CPU_.*)",
// TODO: Sporadic Issue: 45163
R"(.*Behavior.*CancellationTests.*canResetAfterCancelAsyncRequest.*)",
// TODO: Issue: 47271
R"(.*ProposalLayerTest.*)",
};

if (!InferenceEngine::with_cpu_x86_avx512_core()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ std::vector<std::string> disabledTestPatterns() {
R"(.*(DSR_GatherND).*)",
// TODO: Issue 26090
".*DSR_GatherStaticDataDynamicIdx.*f32.*1.3.200.304.*",
// TODO: Issue 47315
".*ProposalLayerTest.*",
// TODO: Issue 46755
".*DSR_GatherElements.*"
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ class ProposalLayerTest

protected:
void SetUp() override;
void Validate() override;
};

} // namespace LayerTestsDefinitions
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,8 @@ void ProposalLayerTest::SetUp() {
std::vector<size_t> imageInfoShape = {3};

auto ngPrc = FuncTestUtils::PrecisionUtils::convertIE2nGraphPrc(InferenceEngine::Precision::FP16);
auto params = ngraph::builder::makeParams(ngPrc, {{"scores", scoresShape}, {"boxes", boxesShape}});
// a_ and b_ are a workaround to solve alphabetic param sorting that destroys ordering
auto params = ngraph::builder::makeParams(ngPrc, {{"a_scores", scoresShape}, {"b_boxes", boxesShape}});
auto paramOuts = ngraph::helpers::convert2OutputVector(ngraph::helpers::castOps2Nodes<ngraph::op::Parameter>(params));

auto proposal = std::dynamic_pointer_cast<ngraph::opset1::Proposal>(
Expand Down Expand Up @@ -126,15 +127,12 @@ InferenceEngine::Blob::Ptr ProposalLayerTest::GenerateInput(const InferenceEngin
InferenceEngine::Blob::Ptr blobPtr;

const std::string name = info.name();
if (name == "scores") {
if (name == "a_scores") {
blobPtr = FuncTestUtils::createAndFillBlobFloat(info.getTensorDesc(), 1, 0, 1000, 8234231);
} else if (name == "boxes") {
} else if (name == "b_boxes") {
blobPtr = FuncTestUtils::createAndFillBlobFloatNormalDistribution(info.getTensorDesc(), 0.0f, 0.2f, 7235346);
}

return blobPtr;
}

// TODO: for validation, reference version is required (#28373)
void ProposalLayerTest::Validate() {}
} // namespace LayerTestsDefinitions
Loading