Git Product home page Git Product logo

yolo-libtorch's Introduction

文档

Yolo-LibTorch旨在使用LibTorch轻松调用Yolo的各种版本YoloV5YoloV6YoloV7YoloV8等(以下结果通过yolov8n模型预测)。此项目需要torchscript的模型格式

快速开始

Windows 中使用(cmake)

  1. 下载所需环境

  2. 配置环境变量

    // 添加libtorch的lib目录到path
    \path\to\libtorch\lib
    // 添加opencv的bin目录到环境变量
    // vc14 vc15 vc16 都可以
    \path\to\opencv\build\x64\vc16\bin
    
  3. 修改根目录下 CMakeLists.txt 文件

    // Torch_DIR 路径为 libtorch 下面的 share/cmake/Torch/
    set(Torch_DIR /path/to/libtorch/share/cmake/Torch/)
    // OpenCV_DIR 路径为 opencv/build/
    set(OpenCV_DIR /path/to/opencv/build/)
    
  4. 编译

    mkdir build
    cd build
    cmake ..
    
    // 根据你 LibTorch 版本选择执行下面语句
    // Debug
    cmake --build . --config Debug
    cmake --install . --config Debug
    
    // Release
    cmake --build . --config Release
    cmake --install . --config Release
    
  5. 测试

    cd bin
    // 默认会打开电脑摄像头捕捉画面
    // 如果电脑没有摄像头可以通过参数引入视频或图片
    test.exe
    

yolo-libtorch's People

Contributors

ncdhz avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.