Giter VIP home page Giter VIP logo

darknet_det's Introduction

darknet_det

  1. Prerequisites

     Ubuntu 
     CUDA
     OpenCV
     gstreamer 
     ROS (gscam)
    
  2. Clone or copy darknet_det code into a ROS worksapce. Suppose the directory tree is as below:

         [ros_ws]/src/darknet_det/ 
    

    from: https://github.com/maoxuli/darknet_det

  3. Clone or copy darknet code to some directory. For example, inside darknet_det directory, or side by side, as shown below:

         [ros_ws]/src/darknet_det/darknet/ 
    
     or  [ros_ws]/src/darknet/ 
    
     or  in other directory 
    

    from: https://github.com/maoxuli/darknet

     or  https://github.com/pjreddie/darknet  
    
  4. Build darknet

     cd [ros_ws]/src/darknet_det/darknet     (according to above step)
    
     edit [ros_ws]/src/darknet_det/darknet/Makefile as below (or according to your situation): 
    
         GPU=1
         CUDNN=1
         OPENCV=1
         OPENMP=1
         DEBUG=0
    
     make 
    
  5. Build darknet_det

     set darknet path in [ros_ws]/src/darknet_det/CMakeLists.txt, according to above steps: 
    
         set(DARKNET_PATH ${CMAKE_CURRENT_SOURCE_DIR}/darknet)
    
     cd [ros_ws] 
    
     catkin_make 
    
  6. Download pre-trained YOLO networks (cfg file, weights file, and names file) to directory shown as below:

         [ros_ws]/src/darket_det/models/yolov3.cfg 
         [ros_ws]/src/darket_det/models/yolov3.weights 
         [ros_ws]/src/darket_det/models/coco.names 
    

    from: https://pjreddie.com/darknet/yolo

     edit darknet detection settings accordingly in [ros_ws]/src/darknet_det/launch/darknet_det.launch, e.g.:
    
         <arg name="cfg_file" default="$(find darknet_det)/models/yolov3.cfg" />
         <arg name="weights_file" default="$(find darknet_det)/models/yolov3.weights" />
         <arg name="names_file" default="$(find darknet_det)/models/coco.names" />
    
     set target object classes for detection as below: 
    
         <rosparam>class_ids: [ 0, 3, 14 ]</rosparam>
    
     the number is the class ID defined by dataset used for network training, e.g. in COCO dataset, ID 0 is for person. 
    
  7. Test with CSI camera on Jetson Xavier/TX2/Nano or Raspberry PI

     cd [ros_ws]
    
     source devel/setup.bash 
    
     edit camera settings in [ros_ws]/src/darknet_det/launch/csi_cam_det.launch 
    
     edit darknet detection settings in [ros_ws]/src/darknet_det/launch/darknet_det.launch 
    
     rolsuanch darknet_det csi_cam_det.launch 
    
  8. Understanding detection result

darknet_det publish deteciton result on topic [camera_name]/det. Please refer to [ros_ws]/src/darknet_det/msg for defined message type. Please note that the bounding box in current implementation is denoted with center point (x, y) and size (w, h), normalized to image size.

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.