This is a ROS package for object detection with the official Yolov7
Built and tested on Python3.8, Ubuntu 20.04, ROS Noetic.
- Clone the package and install dependencies for Yolov7 (follow the guide from the official repository, might be better to set up a virtual environment)
cd <YOUR_ROS_WORKSPACE>/src
git clone https://github.com/phuoc101/yolov7_ros
cd src/yolov7
pip install -r requirements.txt
- Build the package and source it
cd <YOUR_ROS_WORKSPACE>
catkin build yolov7_ros
source devel/setup.bash #or setup.zsh, depends on what shell you're using
# default input image topic is /image_raw, but can be modified by specifying input_img_topic:=<YOUR_TOPIC>
roslaunch yolov7_ros yolov7.launch
# to test with webcam, need to install usb_cam ros package first
roslaunch yolov7_ros yolov7_webcam.launch
Put the weights you want to use in yolov7_ros/src/yolov7/weights
and specifying it during launching
roslaunch yolov7_ros yolov7.launch weights:=weights/<YOUR_WEIGHTS>.pt
# or
roslaunch yolov7_ros yolov7_webcam.launch weights:=weights/<YOUR_WEIGHTS>.pt