Skip to content

Tensor <--> image - Adding per channel compute for Norm mean & Bias#14705

Merged
shalvamist merged 24 commits intomainfrom
Tensor_Image_Adding_dims_to_norm_n_mean
May 1, 2023
Merged

Tensor <--> image - Adding per channel compute for Norm mean & Bias#14705
shalvamist merged 24 commits intomainfrom
Tensor_Image_Adding_dims_to_norm_n_mean

Conversation

@shalvamist
Copy link
Copy Markdown
Contributor

Description

Enabled the use of per channel Bias and Mean normalization when converting an image <--> tensor.

Added a few bug fixes and updates to the relevant E2E test

shalvamist and others added 6 commits January 24, 2023 21:21
Updated the E2E test to cover more configurations of tensor <--> Image utill functions
Updated tensor <--> image utill function implemintation -
* changed offset to stride (better name)
* changed the naming on string use case since it covers both Data URL & URLs on the web
Updated the E2E test for tensor <--> Image conversion
Added support for Norm & Bias per channel
Updated the function toDataURL to modify the canvas directly improving performance
Updated the name of few variables
@shalvamist shalvamist requested a review from a team March 24, 2023 17:19
@shalvamist shalvamist requested a review from fs-eire March 27, 2023 18:32
guschmue
guschmue previously approved these changes Apr 27, 2023
guschmue
guschmue previously approved these changes Apr 27, 2023

if (typeof (norm.mean) === 'number') {
normMean = [norm.mean, norm.mean, norm.mean, norm.mean];
} else {
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.

if mean could be undefined/null, use another if-else clause to process it. norm.mean![0] may throw error if mean is undefined.

@shalvamist shalvamist requested review from fs-eire and guschmue April 28, 2023 21:33
@shalvamist shalvamist merged commit c10a6a9 into main May 1, 2023
@shalvamist shalvamist deleted the Tensor_Image_Adding_dims_to_norm_n_mean branch May 1, 2023 16:37
ShukantPal pushed a commit to ShukantPal/onnxruntime that referenced this pull request May 7, 2023
…icrosoft#14705)

### Description
Enabled the use of per channel Bias and Mean normalization when converting an image <--> tensor.
Added a few bug fixes and updates to the relevant E2E tests.

---------

Co-authored-by: shalvamist <shalva.mist@microsoft.com>
siweic0 pushed a commit to siweic0/onnxruntime-web that referenced this pull request May 9, 2024
…icrosoft#14705)

### Description
Enabled the use of per channel Bias and Mean normalization when converting an image <--> tensor.
Added a few bug fixes and updates to the relevant E2E tests.

---------

Co-authored-by: shalvamist <shalva.mist@microsoft.com>
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.

3 participants