Skip to content
This repository has been archived by the owner on Nov 3, 2022. It is now read-only.

Keras MobileNetv2 image normalization #209

Open
xellDart opened this issue Mar 8, 2022 · 0 comments
Open

Keras MobileNetv2 image normalization #209

xellDart opened this issue Mar 8, 2022 · 0 comments

Comments

@xellDart
Copy link

xellDart commented Mar 8, 2022

Hi, I train my model using keras, and I load data using this function

Resize the images to a fixed input size, and rescale the input channels to a range of [-1,1]

IMG_SIZE = 320 # All images will be resized to 160x160

def format_example(pair):
  image, label = pair['image'], pair['label']
  image = tf.cast(image, tf.float32)
  image = (image/127.5) - 1
  image = tf.image.resize(image, (IMG_SIZE, IMG_SIZE))
  return image, label

But i cant understand what norm mean values apply when I transform my model to other framework, for example, ncnn, Pytorch use

  • loaded in to a range of [0, 1] and then normalized using mean = [0.485, 0.456, 0.406] and std = [0.229, 0.224, 0.225].

But what value I need to apply in keras mobilenetv2 model?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant