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

Commit

Permalink
Replace the custom preprocess_input for MobileNetV2 with the stan…
Browse files Browse the repository at this point in the history
…dard one (#61)
  • Loading branch information
taehoonlee committed Jan 21, 2019
1 parent 7a03145 commit 5f99f52
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions keras_applications/mobilenet_v2.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@

from . import correct_pad
from . import get_submodules_from_kwargs
from . import imagenet_utils
from .imagenet_utils import decode_predictions
from .imagenet_utils import _obtain_input_shape

Expand All @@ -98,19 +99,13 @@
def preprocess_input(x, **kwargs):
"""Preprocesses a numpy array encoding a batch of images.
This function applies the "Inception" preprocessing which converts
the RGB values from [0, 255] to [-1, 1]. Note that this preprocessing
function is different from `imagenet_utils.preprocess_input()`.
# Arguments
x: a 4D numpy array consists of RGB values within [0, 255].
# Returns
Preprocessed array.
"""
x /= 128.
x -= 1.
return x.astype(np.float32)
return imagenet_utils.preprocess_input(x, mode='tf', **kwargs)


# This function is taken from the original tf repo.
Expand Down

0 comments on commit 5f99f52

Please sign in to comment.