前端部署实战_YOLOv5-Lite+树莓派

https://github.com/ppogg/YOLOv5-Lite

一.树莓派编译ncnn

https://blog.csdn.net/sinat_29634715/article/details/120112094

二.树莓派编译ncnn_demo

cmake_minimum_required(VERSION 3.4.1)
set(CMAKE_CXX_STANDARD 17)


project(demo_ncnn)
set(CMAKE_BUILD_TYPE Debug)


find_package(OpenMP REQUIRED)
if(OPENMP_FOUND)
    message("OPENMP FOUND")
    set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}")
    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
    set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${OpenMP_EXE_LINKER_FLAGS}")
endif()


find_package(OpenCV REQUIRED)


find_package(Vulkan REQUIRED)
message(STATUS "Vulkan FOUND = ${Vulkan_FOUND}")
message(STATUS "Vulkan Include = ${Vulkan_INCLUDE_DIRS}")
message(STATUS "Vulkan Lib = ${Vulkan_LIBRARY}")


set(NCNN_LIBS /home/pi/test/ncnn/build/install/lib)  # [DebugMK]
set(NCNN_INCLUDE_DIRS /home/pi/test/ncnn/build/install/include/ncnn)  # [DebugMK]
include_directories(
    ${Vulkan_INCLUDE_DIRS}
    ${NCNN_INCLUDE_DIRS}
    ${OpenCV_INCLUDE_DIRS}
    ${CMAKE_CURRENT_SOURCE_DIR}
    ${CMAKE_CURRENT_BINARY_DIR}
)


link_directories(
    ${NCNN_LIBS}
)


add_executable(demo_ncnn yolov5ss.cpp)


target_link_libraries(  # [DebugMK]
    demo_ncnn
    ncnn.a
    # glslang.a
    # OGLCompiler.a
    # OSDependent.a
    # SPIRV.a
    ${Vulkan_LIBRARY}
    ${OpenCV_LIBS}
)

建立工程项目--->CMake编译--->VSCode单步执行

https://blog.csdn.net/sinat_29634715/article/details/115284697

工程资源:https://download.csdn.net/download/sinat_29634715/2169858

你可能感兴趣的:(边缘计算,NCNN,深度学习)