Should I subtract imagenet precomputation for inception_v3 model on keras inception_v3.py?

def preprocess_input(x):
x /= 255.
x -= 0.5
x *= 2.
return x

      

& emsp; I am using the pre-configured keras inception_v3 imagenet model ( inception_v3.py ) to complete the dataset myself.
& emsp; When I want to subtract the average of the image (123.68, 116.779, 103.939) and the RGB inverse axis in BGR , as we often do, I found that the author provided the _preprocess_input () _ function at end.I is confused about it.

& EPRS; Should I use the provided preprocess_input () function or subtract the mean and the return axis as usual?
& EPRS; Many thanks.

+2


source to share


1 answer


In fact, in the original Inception , the authors specify as the data preprocessor the function you provided (the one that has all channels zero centered and resized to an interval [-1, 1]

). As the InceptionV3 paper does not provide for the transformation of new data I think you can assume that you should use the following function:



def preprocess_input(x):
    x /= 255.
    x -= 0.5
    x *= 2.
    return x

      

+2


source







All Articles