GithubHelp home page GithubHelp logo

pranay731 / ros-semantic-segmentation-pytorch Goto Github PK

View Code? Open in Web Editor NEW

This project forked from csailvision/semantic-segmentation-pytorch

11.0 1.0 6.0 4.03 MB

Pytorch implementation of Semantic Segmentation in ROS on MIT ADE20K dataset based on semantic-segmentation-pytorch by CSAIL

License: BSD 3-Clause "New" or "Revised" License

Shell 0.13% Python 99.79% CMake 0.08%
ros-melodic semantic-segmentation pytorch python3

ros-semantic-segmentation-pytorch's Introduction

Semantic Segmentation for ROS in PyTorch

Based on Sematic Segmentation on MIT ADE20K dataset in PyTorch by CSAIL-Vision

This is a ROS implementation for Semantic Segmentation, build upon semantic-segmentation-pytorch by MIT CSAIL Computer Vision Lab.

The implementation is in Python3 over PyTorch GPU, and holds training and evaluation parts of the parent project. "README_CSAIL.md" should be refered for more info over training.

Environment

The code is tested under the following configuration.

  • Ubuntu 18.04 LTS
  • CUDA=10.2
  • PyTorch>=1.5.1
  • ROS Melodic

1. Installation

A. Prerequisities

  • Install ROS by following the official ROS website.

  • Install dependencies:

sudo apt-get install python-catkin-tools git
# install Python3 dependencies
pip3 install rospkg
pip3 install numpy scipy
pip3 install pytorch>=0.4.1 torchvision
pip3 install yacs tqdm

B. Setup

Using catkin:

# Setup catkin workspace
mkdir -p ~/catkin_ws/src
cd ~/catkin_ws/
catkin init

# Add workspace to bashrc.
echo 'source ~/catkin_ws/devel/setup.bash' >> ~/.bashrc

# Clone repo
cd ~/catkin_ws/src
git clone https://github.com/pranay731/ros-semantic-segmentation-pytorch.git

sudo chmod +x ros-semantic-segmentation-pytorch/scripts/run_semantic_segmentation

# Build 
cd ..
catkin build

# Refresh workspace
source ~/catkin_ws/devel/setup.bash

A number of models are available. Default is resnet50dilated for encoder and ppm_deepsup for decoder. Download pretrained checkpoints for models from CSAIL Website and copy them to src/ros-semantic-segmentation-pytorch/ckpt/{modelname}/

2. Usage

A. Inference

Launch file :

  • Input topic -> raw image rgb topic.
  • gpu_id -> set gpu id for multiple gpu system else 0.
  • cfg_filepath -> path to config file. Should be according to model.
  • model_ckpt_dir -> path to directory containing downloaded checkpoints.

Configuration file contains option "imgSizes" which takes a tuple of heights, over which input image is resized for inference. This can be tweaked according to GPU capablities.

roslaunch semantic_segmentation_ros semantic_segmentation.launch

B. Train and Eval

Follow "README_CSAIL.md" for Training and Evaluation. Train and Eval scripts are present in src/ros-semantic-segmentation-pytorch/scripts directory.

ros-semantic-segmentation-pytorch's People

Contributors

arjo129 avatar devinaconley avatar eugenelawrence avatar hangzhaomit avatar jeremyfix avatar marcoforte avatar pranay731 avatar yagi-3 avatar zhoubolei avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

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.