Skip to content

Commit

Permalink
solve issues 13
Browse files Browse the repository at this point in the history
  • Loading branch information
ncdhz committed May 26, 2022
1 parent 6a41f41 commit b334c67
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
3 changes: 2 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,15 @@ cmake_minimum_required(VERSION 3.10)
# set(Torch_DIR /path/to/libtorch/share/cmake/Torch/)
# set(OpenCV_DIR /path/to/opencv/build/)


project(YoloV5LibTorch)

include_directories(./include)

add_subdirectory(./src)
add_subdirectory(./test)

install(TARGETS test YoloV5
install(TARGETS verification YoloV5
RUNTIME DESTINATION ${CMAKE_SOURCE_DIR}/bin
ARCHIVE DESTINATION ${CMAKE_SOURCE_DIR}/lib
)
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
5. 测试
```
cd bin
test.exe
verification.exe
```
### Linux 等系统中编译此项目
由于没有测试不便多说应该是更加简单,安装好 opencv 和 libtorch 之后直接执行下面代码即可
Expand Down
8 changes: 4 additions & 4 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ install(FILES ./coco.txt ./yolov5s.cpu.pt ./yolov5s.cuda.pt DESTINATION ${CMAKE_
find_package(OpenCV REQUIRED)
find_package(Torch REQUIRED)

add_executable(test test.cpp)
add_executable(verification test.cpp)

target_link_libraries(test YoloV5)
target_link_libraries(test ${OpenCV_LIBS} )
target_link_libraries(test ${TORCH_LIBRARIES})
target_link_libraries(verification YoloV5)
target_link_libraries(verification ${OpenCV_LIBS} )
target_link_libraries(verification ${TORCH_LIBRARIES})

0 comments on commit b334c67

Please sign in to comment.