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

Add arguments to set RGB mean std for IC #1546

Merged
merged 3 commits into from
May 5, 2023
Merged

Add arguments to set RGB mean std for IC #1546

merged 3 commits into from
May 5, 2023

Conversation

anmarques
Copy link
Member

The existing IC flow normalizes the input images using the RGB mean and std values from ImageNet (as is common in many IC flows).
This PR adds arguments that allow the user to override the default values for RGB mean and std. The PR is driven by EficientNetV2-L, which uses different values for the RGB mean and std, but it is a desirable feature in general.

Testing plan:

  1. Evaluated EfficientNetV2-L overriding RGB mean and std and verified accuracy
sparseml.image_classification.train \
    --checkpoint-path zoo:cv/classification/efficientnet_v2-l/pytorch/sparseml/imagenet/base-none \
    --test-only \
    --arch-key efficientnet_v2_l \
    --dataset-path ~/datasets/imagenet_calib \
    --rgb-mean 0.5 0.5 0.5 \
    --rgb-std 0.5 0.5 0.5 \
    --val-crop-size 480 \
    --val-resize-size 480 \
    --interpolation bicubic \
    --batch-size 32
  1. Evaluated EfficietNetV2-S without overriding RGB mean and std and verified accuracy
sparseml.image_classification.train \
    --checkpoint-path zoo:cv/classification/efficientnet_v2-s/pytorch/sparseml/imagenet/base-none \
    --test-only \
    --arch-key efficientnet_v2_s \
    --dataset-path ~/datasets/imagenet_calib \
    --val-crop-size 384 \
    --val-resize-size 384 \
    --batch-size 32

@anmarques anmarques merged commit 48a0113 into main May 5, 2023
12 checks passed
@anmarques anmarques deleted the update/ic/rgb branch May 5, 2023 14:20
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.

None yet

3 participants