Skip to content

Commit

Permalink
Fix normalization error from TF Lite codelab as models from Model Mak…
Browse files Browse the repository at this point in the history
…er use [0, 1] normalization.

PiperOrigin-RevId: 319352280
  • Loading branch information
khanhlvg authored and copybara-github committed Jul 2, 2020
1 parent 9d70a17 commit bb26df4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@
public class ClassifierFloatMobileNet extends Classifier {

/** Float MobileNet requires additional normalization of the used input. */
private static final float IMAGE_MEAN = 127.5f;
private static final float IMAGE_MEAN = 0f;

private static final float IMAGE_STD = 127.5f;
private static final float IMAGE_STD = 255f;

/**
* Float model does not need dequantization in the post-processing. Setting mean and std as 0.0f
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@
public class ClassifierFloatMobileNet extends Classifier {

/** Float MobileNet requires additional normalization of the used input. */
private static final float IMAGE_MEAN = 127.5f;
private static final float IMAGE_MEAN = 0f;

private static final float IMAGE_STD = 127.5f;
private static final float IMAGE_STD = 255f;

/**
* Float model does not need dequantization in the post-processing. Setting mean and std as 0.0f
Expand Down

0 comments on commit bb26df4

Please sign in to comment.