You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mxnet.apache.org by GitBox <gi...@apache.org> on 2018/10/18 01:03:44 UTC

[GitHub] andrewfayres commented on a change in pull request #12848: Fix Batch input issue with Scala Benchmark

andrewfayres commented on a change in pull request #12848: Fix Batch input issue with Scala Benchmark
URL: https://github.com/apache/incubator-mxnet/pull/12848#discussion_r226130728
 
 

 ##########
 File path: scala-package/infer/src/main/scala/org/apache/mxnet/infer/ImageClassifier.scala
 ##########
 @@ -76,7 +76,7 @@ class ImageClassifier(modelPathPrefix: String,
                     topK: Option[Int] = None): IndexedSeq[IndexedSeq[(String, Float)]] = {
 
     val scaledImage = ImageClassifier.reshapeImage(inputImage, width, height)
-    val pixelsNDArray = ImageClassifier.bufferedImageToPixels(scaledImage, inputShape)
+    val pixelsNDArray = ImageClassifier.bufferedImageToPixels(scaledImage, inputShape.drop(1))
 
 Review comment:
   
   
   
   
   
   
   
   ```suggestion
       val imageShape = inputShape.drop(1)
       val pixelsNDArray = ImageClassifier.bufferedImageToPixels(scaledImage, imageShape)
   ```
   I prefer this. Mainly because it makes it more clear why you're dropping part of shape.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services