Skip to content

Commit

Permalink
variable naming updates
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnDoll2023 authored Jul 5, 2022
1 parent e3694b0 commit 1f750b0
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,12 @@ public static void predict() throws IOException, ModelException, TranslateExcept
}

// get image dimensions
final int height = img.getHeight();
final int width = img.getWidth();
int height = img.getHeight();
int width = img.getWidth();

// rgb coloring means and standard deviations for improved detection performance
final float[] MEAN = {0.485f, 0.456f, 0.406f};
final float[] STD = {0.229f, 0.224f, 0.225f};
float[] mean = {0.485f, 0.456f, 0.406f};
float[] std = {0.229f, 0.224f, 0.225f};

Criteria<Image, Image> criteria =
Criteria.builder()
Expand All @@ -82,7 +82,7 @@ public static void predict() throws IOException, ModelException, TranslateExcept
SemanticSegmentationTranslator.builder()
.addTransform(new Resize(width, height))
.addTransform(new ToTensor())
.addTransform(new Normalize(MEAN, STD))
.addTransform(new Normalize(mean, std))
.optSynsetUrl(
"https://mlrepo.djl.ai/model/cv/instance_segmentation/ai/djl/mxnet/mask_rcnn/classes.txt")
.build())
Expand Down

0 comments on commit 1f750b0

Please sign in to comment.