Skip to content
This repository was archived by the owner on Jun 3, 2025. It is now read-only.

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
@anmarques anmarques deleted the update/ic/rgb branch May 5, 2023 14:20
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants