How to normalize image when using pretrained model? #906
Unanswered
jeongHwarr
asked this question in
Q&A
Replies: 1 comment 1 reply
-
@jeongHwarr I think maybe you want the
Then something like img = cv2.imread('img.jpg')
img = cv2.cvtColor(img, cv2.COLOR_BGR2RGB)
img = img / 255.
img -= np.array(model.default_cfg['mean'])
img /= np.array(model.default_cfg['std']) |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I want to use pretrained model.
However, I couldn't find how you did normalization when using the pretrained model.
For example, the PyTorch documentation states:
https://pytorch.org/vision/stable/models.html
How about pytorch-image-models?
Thank you !
Beta Was this translation helpful? Give feedback.
All reactions