NVIDIA / DALI

A GPU-accelerated library containing highly optimized building blocks and an execution engine for data processing to accelerate deep learning training and inference applications.
https://docs.nvidia.com/deeplearning/dali/user-guide/docs/index.html
Apache License 2.0
5.14k stars 620 forks source link

Differences between Image.open and ops.ImageDecoder? #3813

Closed leijuzi closed 2 years ago

leijuzi commented 2 years ago

Hi its me again, I've been implement dali frame process with below code, but when I test 1000 cases compare whit origin torch process, there are 24 results is different. then we compare the features found decode result is differ. soo I want to know its exists differ or its error in my code, thanks very much: image

JanuszL commented 2 years ago

Hi @leijuzi,

I think this https://github.com/NVIDIA/DALI/issues/2789 would explain the possible source of discrepancies you see. Also, it seems that PIL Resize (the one that transforms.Resize is based on) doesn't account for subpixel scales. In such a case, in DALI you need to set subpixel_scale=False. You can use attached jupyter notebook as a reference on how to compare DALI operators with Torch processing.

leijuzi commented 2 years ago

@JanuszL it works very well , thank you