tanakataiki/ssd_kerasV2

preprocess_input

algila opened this issue · 1 comments

Hi,

in file SSD.ipynb code line
inputs = preprocess_input(np.array(inputs))

is it not mentioned the mode used by the keras library. Looking in keras source file this method need a mode that should be "caffe", "tf" or "torch". What is the correct one you used to train your weights ?

Below the keras library code showing the above

def preprocess_input(x, data_format=None, mode='caffe', **kwargs):

    """Preprocesses a tensor or Numpy array encoding a batch of images.
    # Arguments
        x: Input Numpy or symbolic tensor, 3D or 4D.
            The preprocessed data is written over the input data
            if the data types are compatible. To avoid this
            behaviour, `numpy.copy(x)` can be used.
        data_format: Data format of the image tensor/array.

        mode: One of "caffe", "tf" or "torch".
            - caffe: will convert the images from RGB to BGR,
                then will zero-center each color channel with
                respect to the ImageNet dataset,
                without scaling.
            - tf: will scale pixels between -1 and 1,
                sample-wise.
            - torch: will scale pixels between 0 and 1 and then
                will normalize each channel with respect to the
                ImageNet dataset.

Hi

I have used this model in order to study it. I known that this model uses "caffe" mode, and like your question say: you check that the default mode is "caffe" indicated on the signature of the function:
def preprocess_input(x, data_format=None, mode='caffe', **kwargs)