Skip to content

Commit aebfd3d

Browse files
authored
Update README.md
1 parent fcc2e81 commit aebfd3d

File tree

1 file changed

+16
-7
lines changed

1 file changed

+16
-7
lines changed

README.md

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,10 @@ cd lite.ai.toolkit && sh ./build.sh # >= 0.2.0, support Linux only.
6060
```c++
6161
#include "lite/lite.h"
6262

63-
static void test_default() {
64-
std::string onnx_path = "examples/hub/onnx/cv/yolov5s.onnx";
65-
std::string test_img_path = "examples/lite/resources/test_lite_yolov5_1.jpg";
66-
std::string save_img_path = "examples/logs/test_lite_yolov5_1.jpg";
63+
int main(int argc, char *argv[]) {
64+
std::string onnx_path = "../examples/hub/onnx/cv/yolov5s.onnx";
65+
std::string test_img_path = "../examples/lite/resources/test_lite_yolov5_1.jpg";
66+
std::string save_img_path = "../examples/logs/test_lite_yolov5_1.jpg";
6767

6868
auto *yolov5 = new lite::cv::detection::YoloV5(onnx_path);
6969
std::vector<lite::types::Boxf> detected_boxes;
@@ -73,16 +73,25 @@ static void test_default() {
7373
lite::utils::draw_boxes_inplace(img_bgr, detected_boxes);
7474
cv::imwrite(save_img_path, img_bgr);
7575
delete yolov5;
76+
return 0;
7677
}
7778
```
7879
7980
## Quick Setup 👀
8081
8182
To quickly setup `lite.ai.toolkit`, you can follow the `CMakeLists.txt` listed as belows. 👇👀
8283
```cmake
83-
set(LITE_AI_DIR YOUR-PATH-TO/lite.ai.toolkit)
84-
find_package(lite.ai.toolkit REQUIRED PATHS ${LITE_AI_DIR})
85-
add_executable(lite_yolov5 examples/test_lite_yolov5.cpp)
84+
cmake_minimum_required(VERSION 3.10)
85+
project(lite_yolov5)
86+
set(CMAKE_CXX_STANDARD 17)
87+
88+
set(lite.ai.toolkit_DIR YOUR-PATH-TO/lite.ai.toolkit/build/install)
89+
find_package(lite.ai.toolkit REQUIRED PATHS ${lite.ai.toolkit_DIR})
90+
if (lite.ai.toolkit_Found)
91+
message(STATUS "lite.ai.toolkit_INCLUDE_DIRS: ${lite.ai.toolkit_INCLUDE_DIRS}")
92+
message(STATUS "lite.ai.toolkit_LIBS: ${lite.ai.toolkit_LIBS}")
93+
endif()
94+
add_executable(lite_yolov5 test_lite_yolov5.cpp)
8695
target_link_libraries(lite_yolov5 ${lite.ai.toolkit_LIBS})
8796
```
8897

0 commit comments

Comments
 (0)