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

Fixes crash in RandomBBoxCrop when no labels are provided #2265

Merged
merged 2 commits into from
Sep 10, 2020

Conversation

JanuszL
Copy link
Contributor

@JanuszL JanuszL commented Sep 10, 2020

  • ProspectiveCrop assumed that labels are always provided and there the number is equal to the number of bboxes
  • extends logic to support has_labels variable

Signed-off-by: Janusz Lisiecki jlisiecki@nvidia.com

Why we need this PR?

Pick one, remove the rest

  • It fixes a crash in RandomBBoxCrop when no labels are provided

What happened in this PR?

Fill relevant points, put NA otherwise. Replace anything inside []

  • What solution was applied:
    extends logic to support has_labels variable in ProspectiveCrop
  • Affected modules and functionalities:
    RandomBBoxCrop
  • Key points relevant for the review:
    NA
  • Validation and testing:
    CI
  • Documentation (including examples):
    test case has been added

Relates to #2262
JIRA TASK: [NA]

- ProspectiveCrop assumed that labels are always provided and there
  the number is equal to the number of bboxes
- extends logic to support has_labels variable

Signed-off-by: Janusz Lisiecki <jlisiecki@nvidia.com>
@JanuszL
Copy link
Contributor Author

JanuszL commented Sep 10, 2020

!build

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [1614873]: BUILD STARTED

@@ -333,3 +333,21 @@ def test_random_bbox_crop_overlap():
for use_labels in [True, False]:
yield check_random_bbox_crop_overlap, \
batch_size, ndim, crop_shape, input_shape, use_labels

def test_random_bbox_crop_no_lables():
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
def test_random_bbox_crop_no_lables():
def test_random_bbox_crop_no_labels():

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

return out
boxes = fn.external_source(source = get_boxes)
processed = fn.random_bbox_crop(boxes,
aspect_ratio=[0.5, 2.0],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

indentation

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

Signed-off-by: Janusz Lisiecki <jlisiecki@nvidia.com>
@JanuszL
Copy link
Contributor Author

JanuszL commented Sep 10, 2020

!build

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [1614928]: BUILD STARTED

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [1614873]: BUILD FAILED

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [1614873]: BUILD PASSED

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [1614928]: BUILD PASSED

@JanuszL JanuszL merged commit 6fd53de into NVIDIA:master Sep 10, 2020
@JanuszL JanuszL deleted the fix_bbox_crop_no_labels branch September 10, 2020 12:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants