Ros function package of YoloV5

Yolov5_ros

A ROS function package for PyTorch-YOLOv5 based on PyTorch -YOLOv5 is provided . This feature pack has been tested on Ubuntu 16.04 and Ubuntu 18.04.

Authors: Zhitao Zheng ([email protected])
insert image description here

Development environment:

  • Ubuntu 16.04 / 18.04
  • ROS kinetic/melodic
  • Python>=3.6.0 environment, PyTorch>=1.7

Environment configuration installation steps:

Install Anaconda:

1. First download the corresponding installation package [Anaconda] (https://www.anaconda.com/products/individual#linux)

2. Then execute the script to install anaconda (the file name is the .sh file name corresponding to the download)

bash ~/Downloads/Anaconda3-2021.05-Linux-x86_64.sh

Install Pytorch:

1. First create a conda environment of python3.6 or above

conda create -n mypytorch python=3.8

2. Activate the created conda environment

conda activate mypytorch

3. Select the specified version on the PyTorch official website to install Pytorch

Install PyTorch: https://pytorch.org/get-started/locally/

conda install pytorch torchvision torchaudio cpuonly -c pytorch

Install Yolov5_ROS

cd /your/catkin_ws/src

git clone https://github.com/qq44642754a/Yolov5_ros.git

cd yolov5_ros/yolov5

sudo pip install -r requirements.txt

basic usage

  1. First, make sure to put your trained weights in the weights folder.
  2. launch/yolo_v5.launchThe weight file `yolov5s.pt’ is used by default in the file. In addition, you need to additionally modify the name of your corresponding camera topic and whether to use the Cpu option in the launch file:
roslaunch yolov5_ros yolo_v5.launch

Special Instructions:

In view of the fact that many people have recently installed and configured a poorly configured yolov5 environment, I have configured a conda environment named yolov5 here.

Baidu network disk extraction code (pjgj).

After downloading, unzip the file and put it in the /anaconda3/envs/ folder, then run the following command to add it to the conda environment

conda config --add envs_dirs 下载好的yolov5文件夹的路径

finally passed the command

conda  activate yolov5

To activate the conda environment

yolov5

Guess you like

Origin blog.csdn.net/Chris121345/article/details/122563536