espressif / esp-dl

Espressif deep-learning library for AIoT applications
MIT License
516 stars 115 forks source link

fix channel order in convert_to_u8 tool (AIV-676) #153

Closed MrLaki5 closed 4 months ago

MrLaki5 commented 4 months ago

OpenCV imread function loads images in BGR order. ESP-DL required RGB channel ordering, so BGR to RGB conversion is required.

BlueSkyB commented 4 months ago

Hi, thank you for helping to submit the modification. However, the behavior here is correct and does not need to be changed. This is because the existing models in ESP-DL use the BGR order, although the API may be confusing. This can be verified by using the convert_to_u8 tool to convert the image.jpg in various examples under the examples directory, comparing the resulting data file with the corresponding main/image.hpp of each example, and you will find that the data is consistent.

MrLaki5 commented 4 months ago

Hi, thanks for the clarification. If that is the case then no change is required, I will close the PR. My previous comment was referencing this place as it states RGB format: https://github.com/espressif/esp-dl/blob/master/include/model_zoo/human_face_detect_mnp01.hpp#L33