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

[feature] new img container support PNG #380

Merged
merged 9 commits into from
Oct 10, 2024

Conversation

Hanyonggong
Copy link
Contributor

@Hanyonggong Hanyonggong commented Sep 2, 2024

New img container support PNG based on libpng

  • Supports PNG images in all formats
  • Maintain the code style of the new container (like BMP support) in order to abandon libpng in the future
  • It have passed the Lenet model test

To compile target buddy-new-image-container-test:

$ cd buddy-mlir
$ mkdir build
$ cd build
$ cmake -G Ninja ..
-DMLIR_DIR=$PWD/../llvm/build/lib/cmake/mlir
-DLLVM_DIR=$PWD/../llvm/build/lib/cmake/llvm
-DLLVM_ENABLE_ASSERTIONS=ON
-DCMAKE_BUILD_TYPE=RELEASE
-DBUDDY_MLIR_ENABLE_DIP_LIB=ON
$ ninja

@LiuYang328
Copy link
Contributor

Because of the new dependencies and changes to the cmake file, a new version README is needed to guide users build with new container

@Hanyonggong
Copy link
Contributor Author

Because of the new dependencies and changes to the cmake file, a new version README is needed to guide users build with new container

The build commands for the examples has not changed, but the build command for test has changed

@LiuYang328
Copy link
Contributor

Because of the new dependencies and changes to the cmake file, a new version README is needed to guide users build with new container

The build commands for the examples has not changed, but the build command for test has changed

when i build buddy-mlir, i have to enable BUDDY_MLIR_ENABLE_DIP_LIB, otherwise, the build won't succeed. It's best to explain this in the pr.

@Hanyonggong
Copy link
Contributor Author

when i build buddy-mlir, i have to enable BUDDY_MLIR_ENABLE_DIP_LIB, otherwise, the build won't succeed. It's best to explain this in the pr.

Thank you for your question. I have updated the PR to prevent compilation failure due to unspecified parameters

@LiuYang328
Copy link
Contributor

Does libpng have specific version requirements? My current version is 1.6.37
image

when i use new container in MobileNet example, I meet this error

image

Can you try the MobileNet example on your side ? Thank you !

@Hanyonggong
Copy link
Contributor Author

Does libpng have specific version requirements? My current version is 1.6.37 image

when i use new container in MobileNet example, I meet this error

image

Can you try the MobileNet example on your side ? Thank you !

Please refer to the Lenet's CMakeLists.txt for the correct link to the libpng library

@@ -57,5 +57,5 @@ SET_TARGET_PROPERTIES(LENET PROPERTIES LINKER_LANGUAGE C)
add_executable(buddy-lenet-run buddy-lenet-main.cpp)
target_link_directories(buddy-lenet-run PRIVATE ${LLVM_LIBRARY_DIR})

set(BUDDY_LENET_LIBS LENET mlir_c_runner_utils ${OpenCV_LIBS})
set(BUDDY_LENET_LIBS LENET mlir_c_runner_utils ${OpenCV_LIBS} ${PNG_LIBRARY})
Copy link
Contributor

Choose a reason for hiding this comment

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

OpenCV_LIBS can remove

this->sizes[3] = this->width;
this->setStrides();
size_t size = this->product(this->sizes);
std::cout << "size" << size << std::endl;
Copy link
Contributor

Choose a reason for hiding this comment

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

cout 删除

@zhanghb97 zhanghb97 merged commit 026e963 into buddy-compiler:main Oct 10, 2024
1 check passed
ShiHaoGao pushed a commit to ShiHaoGao/buddy-mlir that referenced this pull request Oct 18, 2024
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.

3 participants