Git Product home page Git Product logo

uois's Introduction

Unseen Object Instance Segmentation for Robotic Environments

This is a PyTorch-based implementation of our network, UOIS-Net-3D, for unseen object instance segmentation. Our instance segmentation algorithm utilizes a two-stage method to explicitly leverage the strengths of depth and RGB separately for stronger instance segmentation. Surprisingly, our framework is able to learn from synthetic RGB-D data where the RGB is non-photorealistic. Details of the algorithm can be found in our arXiv paper:

Unseen Object Instance Segmentation for Robotic Environments
Christopher Xie, Yu Xiang, Arsalan Mousavian, Dieter Fox
IEEE Transactions on Robotics (T-RO), 2021.

Installation

We highly recommend setting up a virtual environment using Anaconda. Here is an example setup using these tools:

git clone https://github.com/chrisdxie/uois.git
cd uois3d/
conda env create -f env.yml

Models

You can find the models here. We provide a Depth Seeding Network (DSN) model trained on our synthetic Tabletop Object Dataset (TOD), a Region Refinement Network (RRN) model trained on TOD, and an RRN model trained on real data from the Google Open Images Dataset (OID).

Data

You can find the Tabletop Object Dataset (TOD) here. See the data loading and data augmentation code for more details.

Train the network

We provide sample training code in train_DSN.ipynb and train_RRN.ipynb.

Run the network

See uois_3D_example.ipynb for an example of how to run the network on example images. In order to run this file, Jupyter Notebook must be installed (this is included in env.yml). If you haven't used Jupyter Notebooks before, here is a tutorial to get you up to speed. This repository provides a few images in the example_images folder.

Notes:

  • Make sure to activate the Anaconda environment before running jupyter. This can be done with conda activate uois3d; jupyter notebook
  • the notebook should be run in the directory in which it lives (<ROOT_DIR>), otherwise the filepaths must be manually adjusted.
  • After downloading and unzipping the models, make sure to update checkpoint_dir in uois_3D_example.ipynb to point to the directory where the models live.

Citation

Our code is released under the MIT license.

If you find our work helpful in your research, please cite our work.

@article{xie2021unseen,
author    = {Christopher Xie and Yu Xiang and Arsalan Mousavian and Dieter Fox},
title     = {Unseen Object Instance Segmentation for Robotic Environments},
journal   = {IEEE Transactions on Robotics (T-RO)},
year      = {2021}
}

uois's People

Contributors

chrisdxie avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

uois's Issues

Different results on different GPUs

Hey, I was testing out your repository using the example file provided which had inferences performed on example data. Unfortunately, the results looked completely different on the 2 versions of CUDA and Drivers.
info_2
On this version of the GPU, the following results are obtained:
output_2
output_1
And on the other hand
info_1
With this specification, it got weird:
sample_2
sample_1
I'm not sure what's causing this. I am using the same environment file provided to install everything. Please do let me know if someone has faced a similar issue before. Thanks!

train DSN using my own synthetic dataset

Dear authors,

Thanks for your amazing work. I want to train or finetune DSN by using my own synthetic dataset, may I ask how can I calculate “axis_aligned_bbox3D_center” ?Additionally, what are the "camera_pos", "lookat_pos" and "camera_up_vector" coordinates? I need four of them calculate the ground truth for the 'center_offset_labels' and 'object_centers' for the training data.

Thanks a lot!

Train DSN on Tabletop Object Dataset

Hi, Firstly thank you for great work.

I have an issue when i try to train DSN on your tabletop object dataset following train_DSN.ipynb.
When I run cell with line :

dsn_trainer.train(num_epochs, dl)

I recieve an error

_FileNotFoundError: Caught FileNotFoundError in DataLoader worker process 0.
Original Traceback (most recent call last):
File " ... /venv/lib/python3.8/site-packages/torch/utils/data/_utils/worker.py", line 287, in _worker_loop
data = fetcher.fetch(index)
File " ... /venv/lib/python3.8/site-packages/torch/utils/data/_utils/fetch.py", line 44, in fetch
data = [self.dataset[idx] for idx in possibly_batched_index]
File " ... /venv/lib/python3.8/site-packages/torch/utils/data/_utils/fetch.py", line 44, in
data = [self.dataset[idx] for idx in possibly_batched_index]
File " ... /uois/src/data_loader.py", line 183, in getitem_
scene_description = json.load(open(scene_description_filename))
FileNotFoundError: [Errno 2] No such file or directory:
' ... /uois/tabletop_dataset_v5_public/training_set/scene_25580/scene_description.txt'

I didn't change anything except TOD_filepath and tb_dir.

I suppose it is simply due to a lack of scene_description.txt in every sene.

As I understand ''scene_description is a Python dictionary describing scene''. Can you give example how it should look or how to generate/obtain it?

Issue with setting up Hough_voting_cuda

Hi Chris,

I am using uois2d branch and I followed the installation steps and I am getting an error when running "python setup.py install"

Environment is activated
Using Amazon Linux sagemaker p3.8 instance

The error I'm getting is this :

(uois) [root@ip-172-16-48-121 hough_voting]# python setup.py install
No CUDA runtime is found, using CUDA_HOME='/usr/local/cuda'
running install
running bdist_egg
running egg_info
writing hough_voting.egg-info/PKG-INFO
writing dependency_links to hough_voting.egg-info/dependency_links.txt
writing top-level names to hough_voting.egg-info/top_level.txt
/home/ec2-user/anaconda3/envs/uois/lib/python3.7/site-packages/torch/utils/cpp_extension.py:381: UserWarning: Attempted to use ninja as the BuildExtension backend but we could not find ninja.. Falling back to using the slow distutils backend.
  warnings.warn(msg.format('we could not find ninja.'))
reading manifest file 'hough_voting.egg-info/SOURCES.txt'
writing manifest file 'hough_voting.egg-info/SOURCES.txt'
installing library code to build/bdist.linux-x86_64/egg
running install_lib
running build_ext
Traceback (most recent call last):
  File "setup.py", line 15, in <module>
    'build_ext': BuildExtension
  File "/home/ec2-user/anaconda3/envs/uois/lib/python3.7/site-packages/setuptools/__init__.py", line 153, in setup
    return distutils.core.setup(**attrs)
  File "/home/ec2-user/anaconda3/envs/uois/lib/python3.7/distutils/core.py", line 148, in setup
    dist.run_commands()
  File "/home/ec2-user/anaconda3/envs/uois/lib/python3.7/distutils/dist.py", line 966, in run_commands
    self.run_command(cmd)
  File "/home/ec2-user/anaconda3/envs/uois/lib/python3.7/distutils/dist.py", line 985, in run_command
    cmd_obj.run()
  File "/home/ec2-user/anaconda3/envs/uois/lib/python3.7/site-packages/setuptools/command/install.py", line 67, in run
    self.do_egg_install()
  File "/home/ec2-user/anaconda3/envs/uois/lib/python3.7/site-packages/setuptools/command/install.py", line 109, in do_egg_install
    self.run_command('bdist_egg')
  File "/home/ec2-user/anaconda3/envs/uois/lib/python3.7/distutils/cmd.py", line 313, in run_command
    self.distribution.run_command(command)
  File "/home/ec2-user/anaconda3/envs/uois/lib/python3.7/distutils/dist.py", line 985, in run_command
    cmd_obj.run()
  File "/home/ec2-user/anaconda3/envs/uois/lib/python3.7/site-packages/setuptools/command/bdist_egg.py", line 164, in run
    cmd = self.call_command('install_lib', warn_dir=0)
  File "/home/ec2-user/anaconda3/envs/uois/lib/python3.7/site-packages/setuptools/command/bdist_egg.py", line 150, in call_command
    self.run_command(cmdname)
  File "/home/ec2-user/anaconda3/envs/uois/lib/python3.7/distutils/cmd.py", line 313, in run_command
    self.distribution.run_command(command)
  File "/home/ec2-user/anaconda3/envs/uois/lib/python3.7/distutils/dist.py", line 985, in run_command
    cmd_obj.run()
  File "/home/ec2-user/anaconda3/envs/uois/lib/python3.7/site-packages/setuptools/command/install_lib.py", line 11, in run
    self.build()
  File "/home/ec2-user/anaconda3/envs/uois/lib/python3.7/distutils/command/install_lib.py", line 107, in build
    self.run_command('build_ext')
  File "/home/ec2-user/anaconda3/envs/uois/lib/python3.7/distutils/cmd.py", line 313, in run_command
    self.distribution.run_command(command)
  File "/home/ec2-user/anaconda3/envs/uois/lib/python3.7/distutils/dist.py", line 985, in run_command
    cmd_obj.run()
  File "/home/ec2-user/anaconda3/envs/uois/lib/python3.7/site-packages/setuptools/command/build_ext.py", line 79, in run
    _build_ext.run(self)
  File "/home/ec2-user/anaconda3/envs/uois/lib/python3.7/distutils/command/build_ext.py", line 340, in run
    self.build_extensions()
  File "/home/ec2-user/anaconda3/envs/uois/lib/python3.7/site-packages/torch/utils/cpp_extension.py", line 404, in build_extensions
    self._check_cuda_version()
  File "/home/ec2-user/anaconda3/envs/uois/lib/python3.7/site-packages/torch/utils/cpp_extension.py", line 777, in _check_cuda_version
    torch_cuda_version = packaging.version.parse(torch.version.cuda)
  File "/home/ec2-user/anaconda3/envs/uois/lib/python3.7/site-packages/pkg_resources/_vendor/packaging/version.py", line 56, in parse
    return Version(version)
  File "/home/ec2-user/anaconda3/envs/uois/lib/python3.7/site-packages/pkg_resources/_vendor/packaging/version.py", line 275, in __init__
    match = self._regex.search(version)
TypeError: expected string or bytes-like object
(uois) [root@ip-172-16-48-121 hough_voting]# 

I have tried looking for answers but didn't find any. Hope you can help with this.

Trying reproduce Mark R-CNN method with input as Depth.

Dear @chrisdxie ,
I am trying to reproduce one of the your evaluation methods. (Mask R-CNN method with input as Depth) . I have trained the network using the TOD_train dataset. When I am using OCID and OSD as validation dataset. The results are very bad, the model seems to overfit on OCID validation dataset. I have looked into this repo. There is no code for how you produced the good results for OCID and OSD dataset https://user-images.githubusercontent.com/23742278/148774850-1f5655f4-00d4-40e1-a2fd-1b89af7d318b.png using Mask R-CNN with depth input.
Kindly provide me the config details of how you trained Mask R-CNN with depth input. It would be really helpful.
Thank you @chrisdxie , if anyone else tried to evaluate on Mask R CNN please share the details for training and validation configs.

RuntimeError: Sizes of tensors must match except in dimension 2. Got 53 and 52

Hello!

I am trying to run the model on my own images which have a dimension of 428x760. It seems that when images are not of the original sample image size (480x640) there is an issue with tensor sizes. I have a feeling this might be an issue with upsampling or encoding/decoding in the network. Any suggestions how I can work around this or correct in the code?

Thanks!

TensorIssue_1
TensorIssue_2

Test on OCID and OSD datasets

Hi,
I am trying to test my pretrained network on OCID and OSD datasets, can you provide the source file of preprocessing datasets to npy format? Thanks!

how to run for robotic grasp?

hello!I have seen the youtube of this project.I want to know how to run this project for robotic grasp? Thank you!

Error in installing hough voting layer (cudatoolkit = 9.1)

Great work on the paper!

I am trying to use some of it for a related application. I have created a virtual environment using Anaconda and Pip as recommended. Details of the environment follow. (PyTorch didn't seem to have any binaries for CUDA 9.1, so I used the ones compiled with 9.0). python setup.py install gives multiple errors (see below). Any recommendations regarding what may have caused this error and how to fix it would be deeply appreciated.

Environment details

Collecting environment information...
PyTorch version: 1.0.0
Is debug build: No
CUDA used to build PyTorch: 9.0.176

OS: Ubuntu 18.04.4 LTS
GCC version: (Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0
CMake version: version 3.10.2

Python version: 3.7
Is CUDA available: Yes
CUDA runtime version: 9.1.85
GPU models and configuration:
GPU 0: GeForce GTX 1080 Ti
GPU 1: GeForce GTX 1080 Ti

Nvidia driver version: 440.100
cuDNN version: Could not collect

Versions of relevant libraries:
[pip3] numpy==1.18.5
[pip3] torch==1.0.0
[pip3] torchvision==0.2.1
[conda] blas 1.0 mkl
[conda] cuda90 1.0 h6433d27_0 pytorch
[conda] mkl 2020.1 217
[conda] mkl-service 2.3.0 py37he904b0f_0
[conda] mkl_fft 1.1.0 py37h23d657b_0
[conda] mkl_random 1.1.1 py37h0573a6f_0
[conda] numpy 1.18.5 py37ha1c710e_0
[conda] numpy-base 1.18.5 py37hde5b4d6_0
[conda] pytorch 1.0.0 py3.7_cuda9.0.176_cudnn7.4.1_1 pytorch

Error

I get multiple errors (as included in the following file) when trying to install the Hough voting layer using python setup.py install

error.txt

Depth image normalization

Hi!

How is the depth image normalization performed (xyz)?I check the original rgb and depth image, and the xyz (OCID_image_1.npy) image that you generated on the npy file. How is generated?
depth-result_2018-08-21-14-24-14 (copy)
result_2018-08-21-14-24-14

Issue with Hough_voting_cuda

Hi @chrisdxie ,

Nice work on the paper!

Could you please explain the process for installing the hough_voting_cuda more clearly? I still get "ModuleNotFoundError: No module named 'hough_voting_cuda'"

TypeError: only integer tensors of a single element can be converted to an index

When running uois_example.ipynb I get a "TypeError: only integer tensors of a single element can be converted to an index" when executing code block 7.

nvcc --version = Cuda compilation tools, release 10.0, V10.0.130

`Number of images: 9

/home//anaconda3/envs/uois/lib/python3.7/site-packages/torch/nn/functional.py:2494: UserWarning: Default upsampling behavior when mode=bilinear is changed to align_corners=False since 0.4.0. Please specify align_corners=True if the old behavior is desired. See the documentation of nn.Upsample for details.
"See the documentation of nn.Upsample for details.".format(mode))


TypeError Traceback (most recent call last)
in
3 ### Compute segmentation masks ###
4 st_time = time()
----> 5 fg_masks, direction_predictions, initial_masks, seg_masks = tabletop_segmentor.run_on_batch(batch)
6 total_time = time() - st_time
7 print('Total time taken for Segmentation: {0} seconds'.format(round(total_time, 3)))

~/unseen_object_segmentation/uois/src/segmentation.py in run_on_batch(self, batch)
686
687 # Crop
--> 688 rgb_crop = batch['rgb'][i, :, y_min:y_max+1, x_min:x_max+1] # [3 x crop_H x crop_W]
689 mask_crop = mask[y_min:y_max+1, x_min:x_max+1] # [crop_H x crop_W]
690

TypeError: only integer tensors of a single element can be converted to an index

`

what means of xyz_imgs?

Hi @chrisdxie. In demo, I find input depth info seem is xyz_imgs, a (H, W, 3) images. Is it pointcloud?
in my unstanding, the model only need depth and rbg, so, how to transform depth image to xyz_imgs?

Unable to download dataset.

Hello, I am trying to download Tabletop Object Dataset (TOD) from the link in the description. Initially it failed to download after downloading more than 50%, but now the google drive link is not accessible.
Can someone help me with the alternate way to download the dataset? or is there any other version of the dataset? (As the original version is 35 GB size).
Thank you in advance!
I am pasting the google drive link
https://drive.google.com/uc?export=download&id=157nWfb4pLbwAfOdMLls6q0lZQyqUCvLY

Using it on new data set.

I tried using the network on 4 new images collected from an Intel Realsense. The output of the model is no where close to accurate. Should the model be retrained again with new data set. Following is the result I got.

image

another:

image

Any helpful suggestions on what direction I should move to make it work will be really helpful.

Reproducibility on new dataset

Hi

I am trying to use your network out of the box on a new dataset. I am using your example to get ordered point clouds from the depth images (in mm). However the output for my images is all black. Any pointers why this might happen? I have attached an example output image for your reference.

Figure_1

Thanks

Scene description files

Hi, I am trying to use your model uois3D on a new dataset.
I'm facing a problem with the (process_label_3D) method as I don't have scene description.txt files. I downloaded the TOD dataset from the provided link, and still, I didn't see any scene description text files.
Can you provide a sample of scene description files? Is it possible to use the model in 3D if these files weren't provided?

Amazing work by the way!

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.