Git Product home page Git Product logo

object_detection-'s Introduction

object_detection-

Repo for object detection/localization in ROS with Intel Realsense camera

Setup

Requirements

1) Install ROS melodic

  • Follow the guide here to install ROS melodic
  • paste this into the terminal to install catkin build tools :
sudo apt-get install python-catkin-tools

2) Install Torch (used to run neural network inference)

  • Go to the Nvidia Website here and download the PyTorch v1.8.0 .whl file
  • extract the folder in the home directory and rename it to torch (so the compiler can find it)
  • after that the torch folder will be in your home directory (see below)

follow the other instructions made in the installation section by Nvidia :

wget https://nvidia.box.com/shared/static/p57jwntv436lfrd78inwl7iml6p13fzh.whl -O torch-1.8.0-cp36-cp36m-linux_aarch64.whl
sudo apt-get install python3-pip libopenblas-base libopenmpi-dev 
pip3 install Cython
pip3 install numpy torch-1.8.0-cp36-cp36m-linux_aarch64.whl

After that torch should be installed

Install

1) Create a folder called CATKIN_FS/src/ in your home directory :

mkdir -p CATKIN_FS/src/

2) Clone the repo

git clone https://github.com/Cedric-Perauer/object_detection-.git

3) Move files from the object_detection- folder to the CATKIN_FS/src/ folder :

mv object_detection-/* CATKIN_FS/src/

4) go into the CATKIN_FS directory and build the project with catkin build :

cd CATKIN_FS/ 
catkin build 

5) generate the .engine file :

TODO

6) Change the Line 65 in camera_node/src/yolov5.cpp to point to the .engine file location (replace user name with your username) :

 engine_name = "/home/<user_name>/CATKIN_FS/src/camera_node/src/yolov5s.engine";

do a similar thing in the file camera_node/src/camera_node.cpp (line 23)

std::string paramsFilePath = "/home/<user_name>/CATKIN_FS/camera_node/src/params.txt";

6) go into the CATKIN_FS directory and build the project with catkin build :

cd CATKIN_FS/ 
catkin build 

=> When the build is successful you can download the rosbag file using this link

go into the downloads directory where the .bag file is located and run it with :

rosbag play -l camera.bag 

start the camera_node wit :

rosrun camera_node camera_node 

then you should see an image window openig that looks like this :

Potential Issues Fix :

  • If you run into an issue regarding boost (python_boost) or opencv follow these steps :

1) install OpenCv3 version (paste into terminal) :

sudo apt install libopencv-dev=3.2.0+dfsg-4ubuntu0.1

2) Change the 2 files below :

Commenting row 11 12 in the CMakeLists.txt in the folder vision_opencv/cv_bridge/

if(PYTHONLIBS_VERSION_STRING VERSION_LESS "3.8")
    # Debian Buster
    #find_package(Boost REQUIRED python37)
    #else()
    # Ubuntu Focal
    find_package(Boost REQUIRED python)
  endif()

And adding 0 at the #define NUMPY_IMPORT_ARRAY_RETVAL in the file /usr/include/python2.7/numpy/__multiarray_api.h

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.