Skip to content

BIT-DYN/deeplab_ros

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 

Repository files navigation

deeplab_ros

This is the ROS implementation of the semantic segmentation algorithm Deeplab v3+.

We put two packages here for the convenience of using the correct version of Opencv.

Install

Environmental requirements

You need an Anaconda environment with pytorch installed.

In addition, a few third-party packages (such as catkin_pkg visdom) are required, but there is no specific statistics.

You can install them when an error is reported.

Clone

mkdir DeepLabV3Plus_ws && cd DeepLabV3Plus_ws
mkdir src && cd src
git clone git@github.com:BIT-DYN/deeplab_ros.git
cd ..

Compile

source activate your_env
catkin config
catkin config -DPYTHON_EXECUTABLE=/home/user_name/anaconda3/envs/your_env/bin/python -DPYTHON_INCLUDE_DIR=/home/user_name/anaconda3/envs/your_env/include/python3.7m -DPYTHON_LIBRARY=/home/user_name/anaconda3/envs/your_env/lib/libpython3.7m.so -DCMAKE_BUILD_TYPE=Release -DSETUPTOOLS_DEB_LAYOUT=OFF
catkin_make

Use

Modify

The code needs to be modified for your own use. They are all in the file Img_seg_ros/predict.py. Please modify your path or topic name.

  1. Line 30
sys.path.append('/home/dyn/DeepLabV3Plus_ws/devel/lib/python3.6/site-packages')
  1. Line 51
ckpt = "/home/dyn/DeepLabV3Plus_ws/src/deeplab_ros/Img_seg_ros/best_deeplabv3plus_mobilenet_cityscapes_os16.pth"
  1. Line 112
img_top = "/miivii_gmsl_ros/camera0/image_raw"

Run

source devel/setup.bash
roslaunch img_seg run.launch 

Output

Open rviz to view the topic as '/image_ view/image_seg' color segmentation results. The colors of various categories can be modified in the file Img_seg_ros/datasets/cityscapes.py. The colors of various categories can be modified in the file.

Other introductions

CSDN

About

ROS implementation for Deeplab v3 +

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published