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 2019/01/21 09:13:00 UTC

[GitHub] 2void opened a new issue #13943: mxnet read jpeg images give different values compared with other libs

2void opened a new issue #13943: mxnet read jpeg images give different values compared with other libs
URL: https://github.com/apache/incubator-mxnet/issues/13943
 
 
   ## Description
   Hi, guys! I am a student and recently when my colleagues and I use `imread` in mxnet, version 1.3.1, we found a very strange phenomena. For some jpeg images, the RGB values mxnet read may possibly differ from the values read by other libraries, e.g. skimage, scipy, matplotlib. However, on mxnet, version 1.2.1, everything is fine.
   
   ## Environment info (Required)
   Ubuntu 18.04, Python 3.6.6, Anaconda(conda version 4.5.12), NumPy 1.14.6, skimage 0.14.1
   mxnet 1.3.1 was installed by pip
   
   ## Reproducible example
   1. Here is our result on mxnet=1.3.1. mxnet and skimage give different result! 
   ![example1](https://user-images.githubusercontent.com/19774964/51463590-8979a600-1d9e-11e9-849d-56de639f34b2.png)
   However, skimage, scipy and matplotlib all give the same value!
   ![example2](https://user-images.githubusercontent.com/19774964/51463820-2fc5ab80-1d9f-11e9-944f-b3a15c0991ad.png)
   
   ## Steps to reproduce
   (Paste the commands you ran that produced the error.)
   1. This is our test image
   ![test](https://user-images.githubusercontent.com/19774964/51463303-d4df8480-1d9d-11e9-849f-aa6217d7124c.jpeg)
   2. here's the code
   ```python
   import mxnet
   import skimage.io as io
   import numpy as np
   filename = "test.jpeg"  # this image lead to value inconsistent!
   img_sk = io.imread(filename)
   img_mx = mxnet.image.imread(filename).asnumpy()
   np.where(img_sk != img_mx)  # should be empty!
   # from here you can peek some values using the indices above
   ```
   ```python
   import matplotlib
   import skimage.io as io
   filename = "test.jpeg"
   img_sk = io.imread(filename)
   img_mp = matplotlib.image.imread(filename)
   import numpy as np
   np.where(img_sk != img_mp)
   import scipy
   img_sci = scipy.misc.imread(filename)
   np.where(img_mp != img_sci)
   ```
   
   ## What have you tried to solve it?
   1. The only way to solve this is to use version 1.2.1 instead.
   

----------------------------------------------------------------
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