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

Example of random_mask_pixel to perform biased random crop #2474

Merged
merged 2 commits into from
Nov 18, 2020

Conversation

jantonguirao
Copy link
Contributor

Signed-off-by: Joaquin Anton janton@nvidia.com

Why we need this PR?

Pick one, remove the rest

  • It adds an example (notebook) of a usage of ops.RandomMaskPixel operator to generate crop centers that are placed on foreground pixels of a segmentation mask with a given probability.

What happened in this PR?

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

  • What solution was applied:
    Extended "COCO Reader with augmentations" notebook to show how to perform a biased or balanced random crop, by specifying the probability of the crop window to be centered at a foreground pixel in the segmentation mask.
    Fixed seed generation in RandomMaskPixel to be done per-sample instead of per-thread, for deterministic results
  • Affected modules and functionalities:
    RandomMaskPixel operator
  • Key points relevant for the review:
    All
  • Validation and testing:
    Notebook
  • Documentation (including examples):
    Notebook

JIRA TASK: [DALI-1723]

Signed-off-by: Joaquin Anton <janton@nvidia.com>
@review-notebook-app
Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@review-notebook-app
Copy link

View / edit / reply to this conversation on ReviewNB

mzient commented on 2020-11-17T16:10:25Z
----------------------------------------------------------------

  1. In some segmentation and detection datasets, the density of objects is very low.
  2. To compensate for that
  3. we can select crop windows to be centered at foreground pixels


@review-notebook-app
Copy link

View / edit / reply to this conversation on ReviewNB

mzient commented on 2020-11-17T16:10:26Z
----------------------------------------------------------------

Can we use rel_shape = (1, 1)? It would be more natural if we don't want to flatten remaining dimensions but rather raise an error.


Signed-off-by: Joaquin Anton <janton@nvidia.com>
@jantonguirao jantonguirao requested review from mzient and a team November 18, 2020 07:52
@jantonguirao
Copy link
Contributor Author

!build

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [1809803]: BUILD STARTED

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [1809803]: BUILD PASSED

@jantonguirao jantonguirao merged commit 6463189 into NVIDIA:master Nov 18, 2020
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