Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

preprocess_input #14

Open
algila opened this issue Nov 21, 2018 · 1 comment
Open

preprocess_input #14

algila opened this issue Nov 21, 2018 · 1 comment

Comments

@algila
Copy link

algila commented Nov 21, 2018

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.
@luismikg
Copy link

luismikg commented Mar 8, 2019

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)

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

No branches or pull requests

2 participants