All Projects → martinruenz → Maskfusion

martinruenz / Maskfusion

Licence: other
MaskFusion: Real-Time Recognition, Tracking and Reconstruction of Multiple Moving Objects

Projects that are alternatives of or similar to Maskfusion

Co Fusion
Co-Fusion: Real-time Segmentation, Tracking and Fusion of Multiple Objects
Stars: ✭ 400 (-0.99%)
Mutual labels:  slam, fusion, segmentation, reconstruction, rgbd, tracking
Recent slam research
Track Advancement of SLAM 跟踪SLAM前沿动态【2021 version】
Stars: ✭ 2,387 (+490.84%)
Mutual labels:  slam, fusion, reconstruction
Cilantro
A lean C++ library for working with point cloud data
Stars: ✭ 577 (+42.82%)
Mutual labels:  segmentation, reconstruction, rgbd
dvo python
Coding dense visual odometry in a little more than a night (yikes)!
Stars: ✭ 40 (-90.1%)
Mutual labels:  slam, rgbd
Visual Gps Slam
This is a repo for my master thesis research about the Fusion of Visual SLAM and GPS. It contains the research paper, code and other interesting data.
Stars: ✭ 175 (-56.68%)
Mutual labels:  slam, fusion
Kimera Vio Ros
ROS wrapper for Kimera-VIO
Stars: ✭ 182 (-54.95%)
Mutual labels:  slam, reconstruction
Kimera Vio
Visual Inertial Odometry with SLAM capabilities and 3D Mesh generation.
Stars: ✭ 741 (+83.42%)
Mutual labels:  slam, reconstruction
pcan
Prototypical Cross-Attention Networks for Multiple Object Tracking and Segmentation, NeurIPS 2021 Spotlight
Stars: ✭ 294 (-27.23%)
Mutual labels:  tracking, segmentation
RGB-D-SLAM
Work in Progress. A SLAM implementation based on plane and superquadric tracking.
Stars: ✭ 23 (-94.31%)
Mutual labels:  slam, rgbd
Dynamic ORB SLAM2
Visual SLAM system that can identify and exclude dynamic objects.
Stars: ✭ 89 (-77.97%)
Mutual labels:  segmentation, slam
staticfusion
StaticFusion
Stars: ✭ 107 (-73.51%)
Mutual labels:  slam, rgbd
Awesome Visual Slam
📚 The list of vision-based SLAM / Visual Odometry open source, blogs, and papers
Stars: ✭ 1,336 (+230.69%)
Mutual labels:  slam, reconstruction
DeT
Dataset and Code for the paper "DepthTrack: Unveiling the Power of RGBD Tracking" (ICCV2021), and "Depth-only Object Tracking" (BMVC2021)
Stars: ✭ 39 (-90.35%)
Mutual labels:  tracking, rgbd
StrayVisualizer
Visualize Data From Stray Scanner https://keke.dev/blog/2021/03/10/Stray-Scanner.html
Stars: ✭ 30 (-92.57%)
Mutual labels:  reconstruction, slam
rgbd ptam
Python implementation of RGBD-PTAM algorithm
Stars: ✭ 65 (-83.91%)
Mutual labels:  slam, rgbd
Elasticfusion
Real-time dense visual SLAM system
Stars: ✭ 1,298 (+221.29%)
Mutual labels:  slam, reconstruction
Awesome-Vision-Transformer-Collection
Variants of Vision Transformer and its downstream tasks
Stars: ✭ 124 (-69.31%)
Mutual labels:  tracking, segmentation
Jpdaf tracking
A tracker based on joint probabilistic data association filtering.
Stars: ✭ 107 (-73.51%)
Mutual labels:  fusion, tracking
Kintinuous
Real-time large scale dense visual SLAM system
Stars: ✭ 740 (+83.17%)
Mutual labels:  slam, reconstruction
pedx
Python tools for working with PedX dataset.
Stars: ✭ 26 (-93.56%)
Mutual labels:  tracking, segmentation

MaskFusion

This repository contains MaskFusion, a real-time, object-aware, semantic and dynamic RGB-D SLAM system that goes beyond traditional systems that output a geometry-only map -- MaskFusion recognizes, segments and assigns semantic class labels to different objects in the scene, while tracking and reconstructing them even when they move independently from the camera.

As an RGB-D camera scans a cluttered scene, image-based instance-level semantic segmentation creates semantic object masks that enable real-time object recognition and the creation of an object-level representation for the world map. Unlike previous recognition-based SLAM systems, MaskFusion does not require prior knowledge or known models of the objects it can recognize and can deal with multiple independent motions. Unlike recent semantics enabled SLAM systems that perform voxel-level semantic segmentation MaskFusion takes full advantage of using instance-level semantic segmentation to enable semantic labels to be fused into an object-aware map. We show augmented-reality applications, that demonstrate the unique features of the map output by MaskFusion: instance-aware, semantic and dynamic.

More information and the paper can be found here.

Figure of MaskFusion

Publication

Building MaskFusion

The script build.sh shows step-by-step how MaskFusion is built and which dependencies are required. The following CMake options are mandatory: PYTHON_VE_PATH, MASKFUSION_MASK_RCNN_DIR and it is recommended to set MASKFUSION_GPUS_MASKRCNN as well.

CMake options:

  • MASKFUSION_GPUS_MASKRCNN: List of GPUs used by MaskRCNN, ideally disjunct from SLAM GPU
  • MASKFUSION_GPU_SLAM: GPU use by SLAM system, this has to be the GPU used by OpenGL
  • MASKFUSION_MASK_RCNN_DIR: Path to your Matterport MaskRCNN installation
  • MASKFUSION_NUM_GSURFELS: Surfels allocated for environment model
  • MASKFUSION_NUM_OSURFELS: Surfels allocated per object model
  • PYTHON_VE_PATH: Path to (the root of) virtual python environment, used for tensorflow

Dependencies

  • Python3
  • Tensorflow (>1.3.0, tested with 1.8.0)
  • Keras (>2.1.2)
  • MaskRCNN

Running MaskFusion

  • Select the object categories you would like to label by MaskRCNN. To do so, adjust the array FILTER_CLASSES within Core/Segmentation/MaskRCNN/MaskRCNN.py.in. For instance, FILTER_CLASSES = ['person', 'skateboard', 'teddy bear'] results in skateboards and teddy bears being tracked. In the current setup, regions that are labelled as person are ignored. An empty array indicates that all possible labels should be used.

  • Tracking of individual objects can easily be enabled / disabled by calling makeStatic() and makeNonStatic() of instances of the Model class. The overall system runs more robustly if objects are only tracked when being touched by a person. We are not providing hand-detection software at the moment.

Dataset and evaluation tools

Tools

Hardware

In order to run MaskFusion smoothly, you need a fast GPU with enough memory to store multiple models simultaneously. We used an Nvidia TitanX for most experiments, but also successfully tested MaskFusion on a laptop computer with an Nvidia GeForce™ GTX 960M. If your GPU memory is limited, the MASKFUSION_NUM_GSURFELS and MASKFUSION_NUM_OSURFELS CMake options can help reduce the memory footprint per model (global/object, respectively). While the tracking stage of MaskFusion calls for a fast GPU, the motion based segmentation performance depends on the CPU and accordingly, having a nice processor helps as well.

ElasticFusion

The overall architecture and terminal-interface of MaskFusion is based on ElasticFusion and the ElasticFusion readme file contains further useful information.

New command line parameters (see source-file)

  • -method: Method used for segmentation (cofusion, maskfusion)
  • -frameQ: Set size of frame-queue manually
  • -run: Run dataset immediately (otherwise start paused).
  • -static: Disable multi-model fusion.
  • -confO: Initial surfel confidence threshold for objects (default 0.01).
  • -confG: Initial surfel confidence threshold for scene (default 10.00).
  • -segMinNew: Min size of new object segments (relative to image size)
  • -segMaxNew: Max size of new object segments (relative to image size)
  • -offset: Offset between creating models
  • -keep: Keep all models (even bad, deactivated)
  • -dir: Processes a log-directory (Default: Color####.png + Depth####.exr [+ Mask####.png])
  • -depthdir: Separate depth directory (==dir if not provided)
  • -maskdir: Separate mask directory (==dir if not provided)
  • -exportdir: Export results to this directory, otherwise not exported
  • -basedir: Treat the above paths relative to this one (like depthdir = basedir + depthdir, default "")
  • -colorprefix: Specify prefix of color files (=="" or =="Color" if not provided)
  • -depthprefix: Specify prefix of depth files (=="" or =="Depth" if not provided)
  • -maskprefix: Specify prefix of mask files (=="" or =="Mask" if not provided)
  • -indexW: Number of digits of the indexes (==4 if not provided)
  • -nm: Ignore Mask####.png images as soon as the provided frame was reached.
  • -es: Export segmentation
  • -ev: Export viewport images
  • -el: Export label images
  • -em: Export models (point-cloud)
  • -en: Export normal images
  • -ep: Export poses after finishing run (just before quitting if '-q')
  • -or: Outlier rejection strength (default 3).

Tips

Running MaskRCNN offline, before executing MaskFusion

You can use the script Core/Segmentation/MaskRCNN/offline_runner.py to extract masks readable by MaskFusion and visualisations. Use the -maskdir parameter to input these masks into MaskFusion. Example usage: ./offline_runner.py -i /path/to/rgb/frames -o /path/to/output/masks --filter teddy_bear

The visualization of the output will look like this:

Figure MaskRCNN

Resolve the exception 'Could not open MaskRCNN module':

  • Check python output (run directly in terminal)
  • Check value of CMake option MASKFUSION_MASK_RCNN_DIR
  • Check value of CMake option MASKFUSION_PYTHON_VE_PATH
  • Check if python package pycocotools is missing
  • Check if python package imgaug is missing
  • Check if enough GPU memory is available
  • Check variables PYTHON_VE_PATH and MASK_RCNN_DIR in MaskRCNN.py in your build directory

Resolve the exception '***cudaSafeCall() Runtime API error : unknown error.***' at start-up

One reason for having this exception at start-up can be that OpenGL and Cuda are unable to share memory. Double-check the cmake parameter MASKFUSION_GPU_SLAM, especially in a multi-gpu setup.

Using cv::imshow for debugging

cv::imshow(...) requires the library libopencv_highgui.so, which might (if GTK is used) depend on libmirprotobuf.so and hence on a specific protobuf version. The program, however, is also going to require a specific protobuf version and it can happen that the two versions are clashing leading to an error message like this: This program requires version 3.5.0 of the Protocol Buffer runtime library, but the installed version is 2.6.1. Please update your library. If you compiled the program yourself, make sure that your headers are from the same version of Protocol Buffers as your link-time library. The easiest fix is to compile OpenCV with -DWITH_QT=ON, which removes the protobuf dependency of libopencv_highgui.so.

Crash (segfault) when loading python module MaskRCNN.py

We noticed that loading the python module MaskRCNN.py can crash when the executable links to hdf5 as this is potentially incompatible with the version required by tensorflow. Make sure to use the opencv library that is built in the deps subdirectory, which does not require linking to hdf5. (Set OpenCV_DIR=<path>/deps/opencv/build in cmake)

License

MaskFusion includes the third-party open-source software ElasticFusion, which itself includes third-party open-source software. Each of these components have their own license.

You can find the ElasticFusion license in the file LICENSE-ElasticFusion.txt and the MaskFusion license in the file LICENSE-MaskFusion.txt

Acknowledgements

This work has been supported by the SecondHands project, funded from the EU Horizon 2020 Research and Innovation programme under grant agreement No 643950.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].