Git Product home page Git Product logo

yolov5-libtorch-cpp-opencv-cpp-detection's Introduction

Introduction

A LibTorch inference implementation of the yolov5 object detection algorithm. only CPU is supported.

Dependencies

  • Ubuntu 20
  • OpenCV 4.5
  • LibTorch 1.10.2+cpu

Setup

$ cd /path/to/libtorch_yolo5
$ wget https://download.pytorch.org/libtorch/cpu/libtorch-shared-with-deps-1.10.2%2Bcpu.zip
$ unzip libtorch-shared-with-deps-1.10.2+cpu.zip
$ mkdir build && cd build
$ cmake .. && make

run

   ./libtorch-yolov5 [OPTION...]

   --weights arg      path to model.torchscript.pt
   --classes arg      path to classes name  coco.name
   -i                 image or video/stream default:video
   --source arg       path to source
   --conf-thresh arg  object confidence threshold (default: 0.4)
   --iou-thresh arg   IOU threshold for NMS (default: 0.5)
   --show             display results
   -h, --help         Print usage

video

./libtorch-yolov5 --weights ../weights/yolov5s.torchscript --classes ../weights/coco.names --source ../videos/t2.mp4 [--show] [--conf-thresh] [--iou-thresh]

camera by index

./libtorch-yolov5 --weights ../weights/yolov5s.torchscript --classes ../weights/coco.names --source 0 [--show] [--conf-thresh] [--iou-thresh]

image

./libtorch-yolov5 --weights ../weights/yolov5s.torchscript --classes ../weights/coco.names --source ../images/bus.jpg -i [--show] [--conf-thresh] [--iou-thresh]

yolov5-libtorch-cpp-opencv-cpp-detection's People

Contributors

muhammedakyuzlu 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.