• Stars
    star
    213
  • Rank 185,410 (Top 4 %)
  • Language
    C++
  • License
    Other
  • Created almost 7 years ago
  • Updated almost 3 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Code for SD Mask R-CNN Project

Segmenting Unknown 3D Objects from Real
Depth Images using Mask R-CNN Trained
on Synthetic Data

Michael Danielczuk, Matthew Matl, Saurabh Gupta, Andrew Lee, Andrew Li, Jeffrey Mahler, and Ken Goldberg. https://arxiv.org/abs/1809.05825. Project Page

Install SD Mask R-CNN

To begin using the SD Mask R-CNN repository, clone the repository using git clone https://github.com/BerkeleyAutomation/sd-maskrcnn.git and then run bash install.sh from inside the root directory of the repository. This script will install the repo, and download the available pre-trained model to the models directory, if desired. If dataset generation capabilities are desired, run bash install.sh generation.

Note that these instructions assume a Python 3 environment.

Benchmark a Pre-trained Model

To benchmark a pre-trained model, first download the pre-trained model and extract it to models/sd_maskrcnn.h5. If you have run the install script, then the model has already been downloaded to the correct location. Next, download the WISDOM-Real dataset for testing. Edit cfg/benchmark.yaml so that the test path points to the dataset to test on (typically, /path/to/dataset/wisdom/wisdom-real/high-res/). Finally, run python tools/benchmark.py from the root directory of the project. You may also set the CUDA_VISIBLE_DEVICES if benchmarking using a GPU. Results will be available within the output directory specified in the benchmark.yaml file, and include visualizations of the masks if specified. An example for getting started with benchmarking can be found in this Benchmarking Google CoLab Notebook.

Train a New Model

To train a new model, first download the WISDOM-Sim dataset. Edit cfg/train.yaml so that the test path points to the dataset to train on (typically, /path/to/dataset/wisdom/wisdom-sim/) and adjust training parameters for your GPU (e.g., number of images per GPU, GPU count). Then, run python tools/train.py, again setting CUDA_VISIBLE_DEVICES if necessary.

Note: If you wish to train using single channel images (such as those in WISDOM-Sim), you can change the image_channel_count and mean_pixel parameters to 1 and the single channel mean pixel value, respectively. This option also works when loading pre-trained weights (such as COCO or Imagenet).

Generate a New Dataset

An example for getting started with dataset generation can be found in this Dataset Generation Google CoLab Notebook. To generate a new dataset for training, use the tools/generate_mask_dataset.py script. Edit the corresponding config files (cfg/generate_mask_dataset.yaml, cfg/partials/states.yaml, cfg/partials/mask_dataset.yaml) to fit your needs (specifically, at minimum, you must configure cfg/partials/states.yaml to point at your directory of object meshes). The --save_tensors command line argument allows for saving the state of each heap generated, and the --warm_start option allows for resuming dataset generation if it is stopped. By default, the script outputs a dataset of images to the directory specified on the command line with the following structure:

<dataset root directory>/
    images/
        amodal_masks/
            image_000000/
                channel_000.png
                channel_001.png
                ...
            image_000001/
                channel_000.png
                channel_001.png
                ...
            ...
        depth_ims/
            image_000000.png
            image_000001.png
            ...
        modal_masks/
            image_000000/
                channel_000.png
                channel_001.png
                ...
            image_000001/
                channel_000.png
                channel_001.png
                ...
            ...
        semantic_masks/
            image_000000.png
            image_000001.png
            ...
        train_indices.npy
        test_indices.npy
    metadata.json
    dataset_generation.log
    dataset_generation_params.yaml

The modal and amodal masks directories give binary amodal and modal segmentation masks for each of the objects in the heap. Semantic masks are the single-channel stacked modal masks, and depth_ims contains depth images.

Other Available Tools

Typically, one sets the yaml file associated with the task to perform (e.g., train, benchmark, augment) and then runs the associated script. Benchmarking code for PCL and GOP baselines is also included.

Augment

This operation takes a dataset and injects noise/inpaints images/can apply arbitrary operations upon an image as a pre-processing step. python tools/augment.py

Resize

This operation takes folders of images and corresponding segmasks, and resizes them together to the proper shape as required by Mask-RCNN. python tools/augment.py

Benchmark Baseline

This operation benchmarks the PCL or GOP baselines on a given dataset. Settings for each dataset and PCL method are commented in the corresponding yaml file, as well as visualization and output settings. Run with python tools/benchmark_baseline.py.

To run the GOP baseline, first run these commands from the project root directory to install GOP:

cd sd_maskrcnn/gop && mkdir build && cd build 
cmake .. -DCMAKE_BUILD_TYPE=Release -DUSE_PYTHON=3 && make

To run the PCL baselines, first install python-pcl using the instructions here: https://github.com/strawlab/python-pcl.

Datasets

Datasets for training and evaluation can be found at the Project Page.

Standard Dataset Format

All datasets, both real and sim, are assumed to be in the following format:

<dataset root directory>/
    depth_ims/
        image_000000.png
        image_000001.png
        ...
    modal_segmasks/
        image_000000.png
        image_000001.png
        ...
    segmasks_filled/ (optional)
    train_indices.npy
    test_indices.npy
    ...

All segmasks inside modal_segmasks/ must be single-layer .pngs with 0 corresponding to the background and 1, 2, ... corresponding to a particular instance. Additionally, depth images and ground truth segmasks must be the same size; use resize.py in the pipeline to accomplish this. If using bin-vs-no bin segmasks to toss out spurious predictions, segmasks_filled/ must contain those segmasks. These should be binary (0 if bin, 255 if object). More information can be found in the README.txt file.

Benchmark Output Format

Running benchmark.py will output a folder containing results, which is structured as follows:

<name>/ (results of one benchmarking run)
    modal_segmasks_processed/
    pred_info/
    pred_masks/
        coco_summary.txt
    results_supplement/ (optional)
    vis/ (optional)
    ...

COCO performance scores are located in pred_masks/coco_summary.txt. Images of the network's predictions for each test case can be found in vis if the vis flag is set. More benchmarking outputs (plots, missed images) can be found in results_supplement if the flag is set.

Citation

If you use this code for your research, please consider citing:

@inproceedings{danielczuk2019segmenting,
  title={Segmenting Unknown 3D Objects from Real Depth Images using Mask R-CNN Trained on Synthetic Data},
  author={Danielczuk, Michael and Matl, Matthew and Gupta, Saurabh and Li, Andrew and Lee, Andrew and Mahler, Jeffrey and Goldberg, Ken},
  booktitle={Proc. IEEE Int. Conf. Robotics and Automation (ICRA)},
  year={2019}
}

More Repositories

1

gqcnn

Python module for GQ-CNN training and deployment with ROS integration.
Python
311
star
2

dex-net

Repository for reading the Dex-Net 2.0 HDF5 database of 3D objects, parallel-jaw grasps, and robust grasp metrics
Python
301
star
3

FogROS2

An Adaptive and Extensible Platform for Cloud and Fog Robotics Using ROS 2
Python
177
star
4

meshrender

A set of Python utilities for rendering 3D meshes with OpenGL
Python
135
star
5

rlqp

Accelerating Quadratic Optimization with Reinforcement Learning
87
star
6

autolab_core

Core utilities for Berkeley AutoLab.
Python
81
star
7

AlphaGarden

A fast, first order open-access simulator that integrates single plant growth models with inter-plant competition for sun light and water.
Python
80
star
8

perception

AUTOLab perception toolkit
Python
69
star
9

yumipy

Python control interface for interacting with the ABB YuMi Robot
Python
62
star
10

FogROS

Please see FogROS 2, which is under active development and part of ROS 2. FogROS v1 (this repo) is deprecated.
Python
49
star
11

DART

Python
47
star
12

meshpy

A 3-D triangular mesh package for Python.
Python
42
star
13

ipc-graspsim

C++
36
star
14

ifl_benchmark

Interactive Fleet Learning Benchmark
Python
36
star
15

Urban_Driving_Simulator

FLUIDS is a lightweight driving simulator for benchmarking Deep Reinforcement and Imitation learning algorithms.
Python
23
star
16

dex-nerf-datasets

Datasets for Dex-NeRF: Using a Neural Radiance field to Grasp Transparent Objects
23
star
17

HIL-MT

Multi-Task Hierarchical Imitation Learning of Robot Skills
Python
20
star
18

cloth_simulation

Classes and functions related to 3D fabric simulation
Python
20
star
19

mirage

Mirage: a zero-shot cross-embodiment policy transfer method. Benchmarking code for cross-embodiment policy transfer.
Python
15
star
20

tsc-dl

Visual Transition State Clustering
Python
13
star
21

fog_x

Jupyter Notebook
11
star
22

visualization

Visualization tools for the autolab
Python
8
star
23

RAPID

First-order agriculture simulator and datasets.
Python
8
star
24

OpenRAVE-motion-planner

Python
7
star
25

rlqp-python

Python interface for RQLP (Accelerating Quadratic Optimization with RL)
Python
6
star
26

fogros2-rt-x

Python
6
star
27

IL_ROS_HSR

For performing various learning-based tasks with ROS-based robots.
Python
5
star
28

optimal_manipulation_simulator

generate YuMi optimal manipulation via simulation in ROS for learning 3D motion and collision avoidance
Python
5
star
29

dvrkCalibration

Python
5
star
30

RobotToolChanger

Tool-changer and tool for collaborative and service robots
4
star
31

Traffic_Camera_Pipeline

Python
4
star
32

jointseg

Joint Segmentation of 3D Meshes
Python
4
star
33

FLSpegtransferHO

Python
4
star
34

rlqp_train

Environment and training for RQLP (Accelerating Quadratic Optimization with RL)
Python
3
star
35

LifelongLERFROS

Drivers for the insta360 cameras
Python
3
star
36

RAPID-MOLT

RAPID-MOLT: A Meso-Scale, Open-Source, Low-Cost, Testbed for Robot Assisted Precision Irrigation and Delivery.
Python
3
star
37

h264_image_transport

C++
3
star
38

caging

C++
3
star
39

xray

X-Ray: Mechanical Search for an Occluded Object by Minimizing Support of Learned Occupancy Distributions
Python
3
star
40

endoscope_calibration

This repository contains the scripts used to calibrate the endoscope stereoscopic cameras. It also contains scripts to test the calibration.
Python
3
star
41

IIFL

Implicit Interactive Fleet Learning
Python
3
star
42

L3GS

Jupyter Notebook
2
star
43

Orienting_Novel_3D_Objects

Orienting Novel 3D Objects Using Self-Supervised Learning of Rotation Transforms
Python
2
star
44

FETCH_CORE

Python
2
star
45

exploratory-grasping

Repo for "Exploratory Grasping: Asymptotically Optimal Algorithms for Grasping Challenging Polyhedral Objects"
Python
2
star
46

RL-experiments

Experiments for RL
Jupyter Notebook
2
star
47

bags

Website for ICRA submission on manipulating cables, fabrics, and bags.
HTML
2
star
48

dvrk-vismpc

DVRK code for VisMPC + Fabric project
Python
2
star
49

metarl

Meta RL Project
Jupyter Notebook
2
star
50

masters_control

Python
2
star
51

SkillHub

Python
2
star
52

DSDR

Distributed Spectral Dimensionality Reduction (DSDR)
Scala
2
star
53

malasakit

Malasakit is a customizable participatory assessment platform that collects and integrates quantitative assessment, qualitative feedback, and peer-to-peer collaborative filtering on ways local communities can become better prepared for typhoons and floods.
Python
2
star
54

Kit-Net

Python
2
star
55

dvrk-hierarchical-control

This package is a hierarchical control package for the Da Vinci Research Kit
Python
2
star
56

FLUIDS_IL

Imitation Learning Code for The FLUIDS Simulator
Python
2
star
57

omni_master

Code for using Phantom Omnis as master controllers
C++
2
star
58

PolyPoD

Everything I'll be working on in alphagarden prefs project
Python
2
star
59

dexnet_gui

A GUI for Dex-Net based on ROS and PyQt4
Python
2
star
60

yumirws

Python
1
star
61

nix

Shell
1
star
62

fcgqcnn

Fully-Convolutional version of GQ-CNN
CSS
1
star
63

google_goggles_project

Cloud robotics grasping project using Google Goggles
C++
1
star
64

jester

PHP
1
star
65

ur5py

Python
1
star
66

shiv

1
star
67

HierSupCASE

HTML
1
star
68

line_cutting

This repository contains scripts used for the DVRK cutting experiments.
Python
1
star
69

gym_fluids

OpenAI Gym interface to the FLUIDS simulator
Python
1
star
70

toppling

Python
1
star
71

mplambda

Motion Planning Lambdas
C++
1
star
72

fast_grasp_detect

For supporting our IL_ROS_HSR code
Python
1
star
73

query-incentive-model

Django application to collect emails over internet and run query incentive algorithm on the code
JavaScript
1
star
74

evo-nerf-datasets

corl2022
1
star
75

FLSpegtransfer

Python
1
star
76

yumiplanning

Repo for planning/IK code for the YuMi robot
Python
1
star
77

berkeleyautomation.github.io

JavaScript
1
star
78

fogros2-examples

Examples Applications With FogROS2
C++
1
star
79

legs_ros_ws

C++
1
star