GithubHelp home page GithubHelp logo

keras_model_wrapper's Introduction

Segmentation and classification warpper

This is a simple warpper for using deeplab and Mask-RCNN models in ROS easily. Demo Video

Models currently supported:

  • Segmentation models
    • DeepLabv3 (Xception, MobileNetV2) [1]
    • Mask_RCNN (ResNet50) [2]
  • Classification models [3]
    • VGG (VGG16 and VGG19)
    • ResNet50
    • Inception_V3
    • Xception
    • MobileNet_V2
    • Inception_ResNet_V2
    • Densenet (121, 169, 201)
    • NASNet (mobile and large)

Installation

# create conda environment with python 3.6
conda create --name tf python=3.6
conda activate tf

# Install conda Jupyter notebooks supports.
conda install ipython nb_conda_kernels

# Install tensorflow, cuda and cudnn toolkit. We use cuda10 as example.
conda install -c anaconda tensorflow-gpu=1.14 cudatoolkit=10.0

# Install dependences
pip install cython
pip install Keras==2.2.4 tqdm Pillow scikit-image opencv-python h5py imgaug pycocotools requests

Inference out of the box

# Clone this repo
git clone https://github.com/Jiang-Murray/Keras_Model_Wrapper.git
cd Keras_Model_Wrapper

# Activate environment for tensorflow applications
conda activate tf

# Run DeepLabv3 demo 
python deeplab_demo.py --mode images --model_name xception
python deeplab_demo.py --mode video --model_name mobilenetv2

# Run Mask_RCNN demo
python maskrcnn_demo.py --mode images
python maskrcnn_demo.py --mode video

# Run classification demo on imagenet
python classification.py

Inference with ROS

The program can deal with both compressed and uncompressed image topics for inputs and outputs.

# Run Pascal_Voc trained DeepLabv3 Xception backbone on ROS topic and publish result to /deeplab/semantic/compressed
python ros/deeplab_node.py xception INPUT_TOPIC /deeplab/semantic/compressed

# Run Pascal_Voc trained DeepLabv3 Mobilenetv2 backbone on ROS topic and publish result to /deeplab/semantic/
python ros/deeplab_node.py mobilenetv2 INPUT_TOPIC /deeplab/semantic/compressed

# Run COCO trained Mask_RCNN on ROS topic
python ros/maskrcnn_node.py INPUT_TOPIC

Working with rosbag

# Convert a rosbag to video
python ros/rosbag2video.py --topic INPUT_TOPIC

# Convert a rosbag to image sequences
python ros/rosbag2images.py --topic INPUT_TOPIC --interval 5

Refenerce

  1. https://github.com/bonlime/keras-deeplab-v3-plus
  2. https://github.com/matterport/Mask_RCNN
  3. https://github.com/keras-team/keras-applications

keras_model_wrapper's People

Contributors

jiang-muyun avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  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.