Skip to content

Randomization of transforms per image per batch - #231

Merged
rapids-bot[bot] merged 3 commits into
rapidsai:branch-22.04from
shekhardw:dp_work_feb22
Mar 31, 2022
Merged

rapids-bot[bot] merged 3 commits into
rapidsai:branch-22.04from
shekhardw:dp_work_feb22

Conversation

@shekhardw

Copy link
Copy Markdown
Contributor

As per #225

Randomness updated to be applied to per image in the batch. Existing functionality of applying randomness on entire batch at once is unchanged.

@shekhardw shekhardw added the improvement Improves an existing functionality label Mar 2, 2022
@shekhardw
shekhardw requested a review from a team as a code owner March 2, 2022 00:08
@shekhardw shekhardw self-assigned this Mar 2, 2022
@shekhardw shekhardw added the non-breaking Introduces a non-breaking change label Mar 2, 2022
@chirayuG-nvidia

Copy link
Copy Markdown
Contributor

Changes look fine to me for rand_color_jitter. Performance can be improved by doing some sort of kernel aggregation and selective image level filtering within the kernel. Once we have proved that rand_color_jitter is good for model accuracy/froc scores, can look into optimizing performance for this.

@gigony gigony left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks good to me.
Have some minor suggestions.

Comment thread python/cucim/src/cucim/core/operations/color/jitter.py Outdated
np_output = spt.rand_image_flip(arr_batch, prob=1.0, spatial_axis=(2, 3))
np_output = spt.rand_image_flip(arr_batch,
prob=1.0,
spatial_axis=(2, 3),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Parameter input is not consistent. Here it uses (2, 3), but below code, it uses [2, 3].

img: Any,
spatial_axis: tuple(),
prob: float = 0.1
prob: float = 0.1,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

What would be the good default value for this?
Having 0.5 for the default value looks more useful here?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Will update it.

Co-authored-by: Gigon Bae <gigony@gmail.com>
@jakirkham

jakirkham commented Mar 30, 2022 •

Copy link
Copy Markdown
Member

Generally seems reasonable. Do we want to test whole_batch=False as well?

Edit: Filed issue ( #259 ) to track this.

@jakirkham

Copy link
Copy Markdown
Member

@gpucibot merge

@rapids-bot
rapids-bot Bot merged commit 7602774 into rapidsai:branch-22.04 Mar 31, 2022
@gigony gigony changed the title randomization per image per batch Randomization of transforms per image per batch Apr 7, 2022
@GPUtester

Copy link
Copy Markdown
Contributor

Can one of the admins verify this patch?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

improvement Improves an existing functionality non-breaking Introduces a non-breaking change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants