Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix parsing of JPEG headers #175

Merged
merged 2 commits into from
Sep 20, 2018
Merged

Fix parsing of JPEG headers #175

merged 2 commits into from
Sep 20, 2018

Conversation

JanuszL
Copy link
Contributor

@JanuszL JanuszL commented Sep 18, 2018

Signed-off-by: Janusz Lisiecki jlisiecki@nvidia.com

@JanuszL JanuszL changed the title Fix parsing of JPEG headers [WIP] Fix parsing of JPEG headers Sep 18, 2018
Signed-off-by: Janusz Lisiecki <jlisiecki@nvidia.com>
@JanuszL JanuszL changed the title [WIP] Fix parsing of JPEG headers Fix parsing of JPEG headers Sep 18, 2018
@JanuszL
Copy link
Contributor Author

JanuszL commented Sep 18, 2018

Built and tested 697279.

@ptrendx
Copy link
Member

ptrendx commented Sep 18, 2018

What is the reason of this fix?

@JanuszL
Copy link
Contributor Author

JanuszL commented Sep 18, 2018

In ImageNet we have images which are not handled properly by the host decoder, like there are lacking 'JFIF' string in the header and etc. This patch also add host decoder to our data set tests.

// Slightly modified from https://github.com/apache/incubator-mxnet/blob/master/plugin/opencv/cv_api.cc
// http://www.64lines.com/jpeg-width-height
// Gets the JPEG size from the array of data passed to the function, file reference: http://www.obrador.com/essentialjpeg/headerinfo.htm
// Based on https://github.com/scardine/image_size
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code seems only very slightly modified from the previous version, so I would put both references here (image_size and mxnet)

Signed-off-by: Janusz Lisiecki <jlisiecki@nvidia.com>
@JanuszL JanuszL merged commit 805404d into NVIDIA:master Sep 20, 2018
pribalta pushed a commit to pribalta/DALI that referenced this pull request Oct 1, 2018
* Fix parsing of JPEG headers for host decoder, add more tests

Signed-off-by: Janusz Lisiecki <jlisiecki@nvidia.com>

* Update comment for jpeg.cc code inspiration

Signed-off-by: Janusz Lisiecki <jlisiecki@nvidia.com>
@JanuszL JanuszL deleted the fix_jpeg branch January 9, 2019 06:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants