JPEG decode library used by mxnet

Hi All,

As I understand, Mxnet loads images using OpenCV, which in turn uses libjpeg library in the background for decoding jpeg images.

How can I use another jpeg decompression library, say Intel aeon (https://github.com/NervanaSystems/aeon) for image loading with Mxnet?

Thanks,
Rohit

You don’t have to use the built-in mxnet imread type functions for you reading in the image. For example, you can write your own custom DataLoader/Dataset that uses the jpeg decompression library you want on your images. Once you have read in the image with your library, then you can create an ndarray of the image pixels and use that in your training loop.

Here’s a link to a tutorial on mxnet datasets and dataloaders: https://mxnet.incubator.apache.org/tutorials/gluon/datasets.html

@sad Thank you for your reply. I will check out more about this.

I have a related question: Does mxnet binaries use libjpeg or libjpeg-turbo for jpeg decoding by default? Or is it any other library?

Hi @rohit,

It depends which MXNet you’re using and where you got it from. Just taking mxnet-cu92 from pip as an example, it does appear to be using LIBJPEG_TURBO. See here. And when compiling MXNet from source, you can configure as you wish.

Hi @thomelane,

Thank you for the reply. That seems to answer my question. :slight_smile: