Git Product home page Git Product logo

cosypose's Introduction

CosyPose: Consistent multi-view multi-object 6D pose estimation

Important Note

This repository is no longer being maintained.

If you are looking to use CosyPose and encounter any issues, please see:

https://github.com/Simple-Robotics/cosypose

Citation

If you use this code in your research, please cite the paper:

@inproceedings{labbe2020,
title= {CosyPose: Consistent multi-view multi-object 6D pose estimation}
author={Y. {Labbe} and J. {Carpentier} and M. {Aubry} and J. {Sivic}},
booktitle={Proceedings of the European Conference on Computer Vision (ECCV)},
year={2020}}

News

  • CosyPose is the winning method in the BOP challenge 2020 (5 awards in total, including best overall method and best RGB-only method) ! All the code and models used for the challenge are available in this repository.
  • We participate in the BOP challenge 2020. Results are available on the public leaderboard for 7 pose estimation benchmarks. We release 2D detection models (MaskRCNN) and 6D pose estimation models (coarse+refiner) used on each dataset.
  • The paper is available on arXiv and full code is released.
  • Our paper on CosyPose is accepted at ECCV 2020.

Table of content

Overview

This repository contains the code for the full CosyPose approach, including:

Single-view single-object 6D pose estimator

Single view predictions Given an RGB image and a 2D bounding box of an object with known 3D model, the 6D pose estimator predicts the full 6D pose of the object with respect to the camera. Our method is inspired from DeepIM with several simplications and technical improvements. It is fully implemented in pytorch and achieve single-view state-of-the-art on YCB-Video and T-LESS. We provide pre-trained models used in our experiments on both datasets. We make the training code that we used to train them available. It can be parallelized on multiple GPUs and multiple nodes.

Synthetic data generation

Synthetic images The single-view 6D pose estimation models are trained on a mix of synthetic and real images. We provide the code for generating the additionnal synthetic images.

Multi-view multi-object scene reconstruction

Multiview

Single-view object-level reconstruction of a scene often fails because of detection mistakes, pose estimation errors and occlusions; which makes it inpractical for real applications. Our multi-view approach, CosyPose, addresseses these single-view limitations and helps improving 6D pose accuracy by leveraging information from multiple cameras with unknown positions. We provide the full code, including robust object-level multi-view matching and global scene refinement. The method is agnostic to the 6D pose estimator used, and can therefore be combined with many other existing single-view object pose estimation method to solve problems on other datasets, or in real scenarios. We provide a utility for running CosyPose given a set of input 6D object candidates in each image.

BOP challenge 2020: single-view 2D detection + 6D pose estimation models

BOP We used our {coarse+refinement} single-view 6D pose estimation method in the BOP challenge 2020. In addition, we trained a MaskRCNN detector (torchvision's implementation) on each of the 7 core datasets (LM-O, T-LESS, TUD-L, IC-BIN, ITODD, HB, YCB-V). We provide 2D detectors and 6D pose estimation models for these datasets. All training (including 2D detector), inference and evaluation code are available in this repository. It can be easily used for another dataset in the BOP format.

Installation

git clone --recurse-submodules https://github.com/ylabbe/cosypose.git
cd cosypose
conda env create -n cosypose --file environment.yaml
conda activate cosypose
git lfs pull
python setup.py install

The installation may take some time as several packages must be downloaded and installed/compiled. If you plan to change the code, run python setup.py develop.

Notes:

  • We use the bop_toolkit to compute some evaluation metrics on T-LESS. To ensure reproducibility, we use our own fork of the repository. It is downloaded in deps/.

Downloading and preparing data

Click for details...

All data used (datasets, models, results, ...) are stored in a directory local_data at the root of the repository. Create it with mkdir local_data or use a symlink if you want the data to be stored at a different place. We provide the utility cosypose/scripts/download.py for downloading required data and models. All of the files can also be downloaded manually.

BOP Datasets

For both T-LESS and YCB-Video, we use the datasets in the BOP format. If you already have them on your disk, place them in local_data/bop_datasets. Alternatively, you can download it using :

python -m cosypose.scripts.download --bop_dataset=ycbv
python -m cosypose.scripts.download --bop_dataset=tless

Additionnal files that contain informations about the datasets used to fairly compare with prior works on both datasets.

python -m cosypose.scripts.download --bop_extra_files=ycbv
python -m cosypose.scripts.download --bop_extra_files=tless

We use pybullet for rendering images which requires object models to be provided in the URDF format. We provide converted URDF files, they can be downloaded using:

python -m cosypose.scripts.download --urdf_models=ycbv
python -m cosypose.scripts.download --urdf_models=tless.cad

In the BOP format, the YCB objects 002_master_chef_can and 040_large_marker are considered symmetric, but not by previous works such as PoseCNN, PVNet and DeepIM. To ensure a fair comparison (using ADD instead of ADD-S for ADD-(S) for these objects), these objects must not be considered symmetric in the evaluation. To keep the uniformity of the models format, we generate a set of YCB objects models_bop-compat_eval that can be used to fairly compare our approach against previous works. You can download them directly:

python -m cosypose.scripts.download --ycbv_compat_models

Notes:

  • The URDF files were obtained using these commands (requires meshlab to be installed):
python -m cosypose.scripts.convert_models_to_urdf --models=ycbv
python -m cosypose.scripts.convert_models_to_urdf --models=tless.cad
  • Compatibility models were obtained using the following script:
python -m cosypose.scripts.make_ycbv_compat_models

Pre-trained models

The pre-trained models of the single-view pose estimator can be downloaded using:

# YCB-V Single-view refiner
python -m cosypose.scripts.download --model=ycbv-refiner-finetune--251020

# YCB-V Single-view refiner trained on synthetic data only 
# Only download this if you are interested in retraining the above model 
python -m cosypose.scripts.download --model=ycbv-refiner-syntonly--596719

# T-LESS coarse and refiner models 
python -m cosypose.scripts.download --model=tless-coarse--10219
python -m cosypose.scripts.download --model=tless-refiner--585928

2D detections

To ensure a fair comparison with prior works on both datasets, we use the same detections as DeepIM (from PoseCNN) on YCB-Video and the same as Pix2pose (from a RetinaNet model) on T-LESS. Download the saved 2D detections for both datasets using

python -m cosypose.scripts.download --detections=ycbv_posecnn

# SiSo detections: 1 detection with highest per score per class per image on all images
# Available for each image of the T-LESS dataset (primesense sensor)
# These are the same detections as used in Pix2pose's experiments
python -m cosypose.scripts.download --detections=tless_pix2pose_retinanet_siso_top1

# ViVo detections: All detections for a subset of 1000 images of T-LESS.
# Used in our multi-view experiments.
python -m cosypose.scripts.download --detections=tless_pix2pose_retinanet_vivo_all

If you are interested in re-training a detector, please see the BOP 2020 section.

Notes:

  • The PoseCNN detections (and coarse pose estimates) on YCB-Video were extracted and converted from these PoseCNN results.
  • The Pix2pose detections were extracted using pix2pose's code. We used the detection model from their paper, see here. For the ViVo detections, their code was slightly modified. The code used to extract detections can be found here.

Note on GPU parallelization

Click for details...

Training and evaluation code can be parallelized across multiple gpus and multiple machines using vanilla torch.distributed. This is done by simply starting multiple processes with the same arguments and assigning each process to a specific GPU via CUDA_VISIBLE_DEVICES. To run the processes on a local machine or on a SLUMR cluster, we use our own utility job-runner but other similar tools such as dask-jobqueue or submitit could be used. We provide instructions for single-node multi-gpu training, and for multi-gpu multi-node training on a SLURM cluster.

Single gpu on a single node

# CUDA ID of GPU you want to use
export CUDA_VISIBLE_DEVICES=0
python -m cosypose.scripts.example_multigpu

where scripts.example_multigpu can be replaced by scripts.run_pose_training or scripts.run_cosypose_eval (see below for usage of training/evaluation scripts).

Configuration of job-runner for multi-gpu usage

Change the path to the code directory, anaconda location and specify a temporary directory for storing job logs by modifying `job-runner-config.yaml'. If you have access to a SLURM cluster, specify the name of the queue, it's specifications (number of GPUs/CPUs per node) and the flags you typically use in a slurm script. Once you are done, run:

runjob-config job-runner-config.yaml

Multi-gpu on a single node

# CUDA IDS of GPUs you want to use
export CUDA_VISIBLE_DEVICES=0,1
runjob --ngpus=2 --queue=local python -m cosypose.scripts.example_multigpu

The logs of the first process will be printed. You can check the logs of the other processes in the job directory.

On a SLURM cluster

runjob --ngpus=8 --queue=gpu_p1  python -m cosypose.scripts.example_multigpu

Reproducing single-view results

Click for details...

YCB-Video

python -m cosypose.scripts.run_cosypose_eval --config ycbv

This will run the inference and evaluation on YCB-Video. We use our own implementation of the evaluation. We have checked that it matches the results from the original matlab implementation for the AUC of ADD-S and AUC of ADD(-S) metrics. For example, you can see that the PoseCNN results are similar to the ones reported in the PoseCNN/DeepIM paper:

PoseCNN/AUC of ADD(-S): 0.613

The YCB-Video results and metrics can be downloaded directly:

python -m cosypose.scripts.download --result_id=ycbv-n_views=1--5154971130

T-LESS

python -m cosypose.scripts.run_cosypose_eval --config tless-siso

This will run inference on the entire T-LESS dataset and print some metrics but not e_vsd<0.3 which is not supported in our code. The results can also be downloaded:

python -m cosypose.scripts.download --result_id=tless-siso-n_views=1--684390594

To measure e_vsd<0.3, we use the BOP Toolkit. You can run it using:

python -m cosypose.scripts.run_bop_eval --result_id=tless-siso-n_views=1--684390594 --method=pix2pose_detections/refiner/iteration=4

This will create a local_data/bop_predictions_csv/cosyposeXXXX-eccv2020_tless-test-primesense.csv file in the BOP format and run evaluation. Intermediate metrics and final scores are saved in local_data/bop_eval_outputs/cosposyXXXX-eccV2020_tless-test-primesense/, where XXXXX correponds to a random number generated by the script.

The T-LESS SiSo results can also be downloaded directly:

python -m cosypose.scripts.download --bop_result_id=cosypose847205-eccv2020_tless-test-primesense

You can check the results match those from the paper:

cat local_data/bop_eval_outputs/cosypose847205-eccv2020_tless-test-primesense/error\=vsd_ntop\=1_delta\=15.000_tau\=20.000/scores_th\=0.300_min-visib\=0.100.json

{
  "gt_count": 69545,
  "mean_obj_recall": 0.6378486071644157,
  "mean_scene_recall": 0.6444110450903551,
  ...
  "recall": 0.632720209307857,
  ...
  "targets_count": 50452,
  "tp_count": 31922
}

Following other works, we reported mean_obj_recall in the paper.

Single-view visualization

You can visualize the single-view predictions using this notebook as example.

Training the single-view 6D pose estimation models

Click for details...

Downloading synthetic images

The pose estimation models are trained on a mix of real images provided with the T-LESS/YCB-Video datasets and a set of images that we generated. For each dataset, we generated 1 million synthetic images. You can download these large datasets:

# 106 GB
python -m cosypose.scripts.download --synt_dataset=tless-1M

# 113 GB
python -m cosypose.scripts.download --synt_dataset=ycbv-1M

We provide below the instructions to generate these dataset locally if you are interested in using our synthetic data generation code.

Synthetic data generation

Textures for domain randomization

The synthetic training images are generated with some domain randomization. It includes adding textures to the background (and objects and T-LESS). We use a set of textures extracted from ShapeNet objects. Download the texture dataset:

python -m cosypose.scripts.download --texture_dataset

Recording a synthetic dataset

The synthetic images are generated using multiple proceses managed by dask. The synthetic training images can be generated using the following commands for both datasets:

export CUDA_VISIBLE_DEVICES=0
python -m cosypose.scripts.run_dataset_recording --config tless --local
python -m cosypose.scripts.run_dataset_recording --config ycbv --local

Make sure that enough space is available on your disk. We generate 1 million images which is around 120GB for each dataset. Note that we use a high number of synthetic images, but it may be possible to use fewer images. Please see directly the script scripts/run_dataset_recording.py for additionnal parameters. It is also possible to use dask-jobqueue to generate the images on a cluster but we do not provide a simple configuration script for this at the moment. If you are interested in generating data using multiple machines on a cluster, you will have to modify dask-jobqueue's Cluster definition here.

Visualizing images of the dataset

You can visualize the images of the generated dataset using this notebook. You can check that the ground truth prvided by a dataset is correct using this notebook.

Background images for data augmentation

We apply data augmentation to the training images. Data augmentation includes pasting random images of the pascal VOC dataset on the background of the scenes. You can download Pascal VOC using the following commands:

cd local_data
wget http://host.robots.ox.ac.uk/pascal/VOC/voc2012/VOCtrainval_11-May-2012.tar
tar -xvf VOCtrainval_11-May-2012.tar

(If the website is down, which happens periodically, you can alternatively download these files from a mirror at https://pjreddie.com/media/files/VOCtrainval_11-May-2012.tar)

Training script

Once you have generated the synthetic data images and downloaded pascal VOC, you can run the training script. On YCB-Video, we train a coarse model on synthetic data only and fine-tune it on the synthetic + real images. On T-LESS, we train a coarse and refinement model and synthetic + provided real images of isolated objects directly from scratch. In our experiments, all models are trained using the same procedure on 32 GPUs.

runjob --ngpus=32 python -m cosypose.scripts.run_pose_training --config ycbv-refiner-syntonly
runjob --ngpus=32 python -m cosypose.scripts.run_pose_training --config ycbv-refiner-finetune
runjob --ngpus=32 python -m cosypose.scripts.run_pose_training --config tless-coarse
runjob --ngpus=32 python -m cosypose.scripts.run_pose_training --config tless-refiner

You can visualize the logs of the provided models in this notebook.

Logs

You can add the run_id of each model that are your are training to visualize training metrics.

Notes:

  • While we used 32 GPUs in our experiments, the training script can be ran with any number of GPUs. It will just be slower and the overall batch size will be smaller. We have not studied the impact of batch size on final performance of the model. On 32 NVIDIA V100, training a model takes approximately 10 hours. Note that the models are trained from scratch on all the objects of each dataset simulatenously.
  • If you are interested in training with limited resources, you could consider the following changes to the code: (a) use a smaller backbone, e.g. flownet, resnet18 or resnet34, (b) train for fewer iterations, (c) start from one of our pre-trained models. All the parameters are defined in cosypose/scripts/run_pose_training.py. If you are trying to train with limited resources or on your own dataset and datas, please do not hesitate to share your experience, by opening an issue or by sending an email !
  • We run evaluation of the models a few times during training. You can disable it by adding the flag --no-eval to speed up training. Note that the we do not use the evaluation metrics to find the best model since no official validation splits are available for YCB-Video/T-LESS. We always report results for the model obtained at the end of the training.

Reproducing multi-view results

Click for details...

The following scripts will run the full CosyPose pipeline (single-view predictions + multi-view scene reconstruction), compute the metrics reported in the paper and save the results to a directory in local_data/results/.

export CUDA_VISIBLE_DEVICES=0
python -m cosypose.scripts.run_cosypose_eval --config tless-vivo --nviews=4
python -m cosypose.scripts.run_cosypose_eval --config tless-vivo --nviews=8
python -m cosypose.scripts.run_cosypose_eval --config ycbv --nviews=5

Note that the inference and evaluation can be sped up using runjob if you have access to multiple GPUs. The mAP@ADD-S<0.1d and AUC of ADD-S metrics are computed using our own code since they are not supported by the BOP toolkit. We refer to the appendix of the main paper for more details on these metrics.

The results can be also downloaded directly:

# YCB-Video 5 views
python -m cosypose.scripts.download --result_id=ycbv-n_views=5--8073381555 

# T-LESS ViVo 4 views
python -m cosypose.scripts.download --result_id=tless-vivo-n_views=4--2731943061

# T-LESS ViVo 8 views
python -m cosypose.scripts.download --result_id=tless-vivo-n_views=8--2322743008

On T-LESS ViVo, the evsd<0.3 and ADD-S<0.1d metrics are computed using the BOP toolkit, for example for computing the multi-view results for ViVo 8 views:

python -m cosypose.scripts.run_bop_eval  --results  tless-vivo-n_views=8--2322743008 --method pix2pose_detections/ba_output+all_cand --vivo

The ba_output+all_cand predictions correspond to the output of CosyPose concatenated to all the single-view candidates as explained in the experiment section of the paper. The single-view candidates have strictly lower score than the multi-view predictions, which means that single-view estimates are used for evaluation only if there are no multi-view predictions for an object, e.g. typically because a camera cannot be placed with respect to the scene because there are too few inlier candidates.

We also provide the BOP evaluation results that we computed and reported in the paper:

# T-LESS ViVo 1 view
python -m cosypose.scripts.download --bop_results=cosypose68486-eccv2020_tless-test-primesense

# T-LESS ViVo 4 views
python -m cosypose.scripts.download --bop_results=cosypose615294-eccv2020_tless-test-primesense

# T-LESS ViVo 8 views
python -m cosypose.scripts.download --bop_result_id=cosypose114533-eccv2020_tless-test-primesense

Multi-view visualization

You can use this notebook to visualize the multi-view results on YCB-Video and T-LESS and generate the 3D visualization GIFs.

plots_cosypose

GIF

Running CosyPose in a custom scenario

Click for details...

Stage 2 and 3 of CosyPose are agnostic to the 6D pose estimator used, and can therefore be combined with many other existing single-view object pose estimation method to solve problems on other datasets, or for real applications. We provide a utility for running CosyPose given a set of input 6D object candidates in each image.

If you are willing to combine CosyPose with your own pose estimator, you will need to provide the following:

  • The 3D models of the objects considered and their associated symmetries. The models should be provided in a format similar to the BOP format in a models directory.
  • A set of input 6D object candidates in each image candidates.csv. We use the same convention as the BOP format, but all the candidates in this file must be provided for a unique scene (a single 3D reconstruction) in different views.
  • The intrinsics parameters of the cameras of each view in a file scene_camera.json following the BOP format.

Use these commands to create a custom scenario with T-LESS objects and run CosyPose on it:

cd local_data
mkdir -p custom_scenarios/example
ln -s $(pwd)/bop_datasets/tless/models custom_scenarios/example

export CUDA_VISIBLE_DEVICES=0
python -m cosypose.scripts.download --example_scenario
python -m cosypose.scripts.run_custom_scenario --scenario=example

This will generate the following files:

  • results/subscene=0/predicted_scene.json a set of predicted objects and cameras with their associated poses in a common reference frame.
  • results/subscene=0/scene_reprojected.csv poses of predicted objects expressed in camera frames, in the BOP format.

You can use this as an example to check the different formats in which the informations should be provided.

Notes:

  • This is experimental. The default parameters for the pipeline should give good results in many scenarios (we use the same on YCB-Video and T-LESS) but we have yet not conducted experiments in many custom scenarios. If you are trying to apply CosyPose to your own 6D pose estimations and encounter any issues or would like to obtain better results, please consider sharing your experience, I would be very happy to help you.

  • The script is quite slow to run for a single scene because all models need to be loaded and the first cuda call with pytorch is always slow. If you would like to use this for an application, consider using directly the API of the MultiviewScenePredictor in your own code. You can use the script scripts/run_custom_scenario.py as an example on how to use it.

  • While the object candidate matching stage (stage 2 of CosyPose) is fairly optimized using a combination of C++ and fully batched operations in pytorch on GPU, the stage 3 (global scene refinement via object-level bundle adjustment) could largely be sped up. The implementation would benefit from being written in C++ with a standard optimization framework instead of using pytorch to compute full jacobians for Levenberg-Marquart. If you find this stage to be too slow for your problem/application, please open an issue or let me know. If there is demand for a faster implementation, I may provide it in the future.

BOP20 models and results

Click for details...

We provide the training code that we used to train single-view single-object pose estimation models on the 7 core datasets (LM-O, TLESS, TUD-L, IC-BIN, ITODD, HB, YCB-V) and pre-trained detector and pose estimation models. Note that these models are different from the ones used in the paper. The differences with the models used in the paper are the following:

  • In the paper, we use already available detectors for T-LESS and YCB-Video. For the BOP20 challenge, we trained our own detectors on each dataset.
  • Detection and pose estimation models are trained using PBR synthetic images provided with the BOP challenge instead of using our own synthetic data to make it easier to compare fairly with the other approaches.
  • In the BOP20 challenge results, the initialization of the pose provided to the coarse model is slightly different. First, the canonical orientation has been changed to have the z-axis parallel to the camera instead of having the x-axis parallel to the camera, a position with z-axis upward and parallel to the camera makes the overall shape and details of the objects more visible. Second, instead of fixing the z value of the canonical translation to 1 meter, we compute a guess of object depth using the height and width of the 2D bounding box and the 3D model. This makes the method more general as the canonical depth is always within a reasonable range of the correct depth even if the object is very far from the camera.

Even though the challenge is focused on single-view pose estimation, we also reported multi-view results on YCB-Video, T-LESS and HB for 4 and 8 views.

Downloading BOP datasets

python -m cosypose.scripts.download --bop_dataset=DATASET --pbr_training_images
python -m cosypose.scripts.download --urdf_models=DATASET

for DATASET={hb,icbin,itodd,lm,lmo,tless,tudl,ycbv}. If you are not interested in training the models, you can remove the flag --pbr_training_images and you can omit lm.

Pre-trained models

You can download all the models that we trained for the challenge using our downloading script:

python -m cosypose.scripts.download --model=model_id

where model_id is given by the table below:

Dataset Model type Training images model_id
hb detector PBR detector-bop-hb-pbr--497808
hb coarse PBR coarse-bop-hb-pbr--7075
hb refiner PBR refiner-bop-hb-pbr--247731
icbin detector PBR detector-bop-icbin-pbr--947409
icbin coarse PBR coarse-bop-icbin-pbr--915044
icbin refiner PBR refiner-bop-icbin-pbr--841882
lmo detector PBR detector-bop-lmo-pbr--517542
lmo coarse PBR coarse-bop-lmo-pbr--707448
lmo refiner PBR refiner-bop-lmo-pbr--325214
itodd detector PBR detector-bop-itodd-pbr--509908
itodd coarse PBR coarse-bop-itodd-pbr--681884
itodd refiner PBR refiner-bop-itodd-pbr--834427
tless detector PBR detector-bop-tless-pbr--873074
tless coarse PBR coarse-bop-tless-pbr--506801
tless refiner PBR refiner-bop-tless-pbr--233420
tless detector SYNT+REAL detector-bop-tless-synt+real--452847
tless coarse SYNT+REAL coarse-bop-tless-synt+real--160982
tless refiner SYNT+REAL refiner-bop-tless-synt+real--881314
tudl detector PBR detector-bop-tudl-pbr--728047
tudl coarse PBR coarse-bop-tudl-pbr--373484
tudl refiner PBR refiner-bop-tudl-pbr--487212
tudl detector SYNT+REAL detector-bop-tudl-synt+real--298779
tudl coarse SYNT+REAL coarse-bop-tudl-synt+real--610074
tudl refiner SYNT+REAL refiner-bop-tudl-synt+real--423239
ycbv detector PBR detector-bop-ycbv-pbr--970850
ycbv coarse PBR coarse-bop-ycbv-pbr--724183
ycbv refiner PBR refiner-bop-ycbv-pbr--604090
ycbv detector SYNT+REAL detector-bop-ycbv-synt+real--292971
ycbv coarse SYNT+REAL coarse-bop-ycbv-synt+real--822463
ycbv refiner SYNT+REAL refiner-bop-ycbv-synt+real--631598

The detectors are MaskRCNN models with resnet50 FPN backbone. PBR corresponds to training only on provided synthetic images. SYNT+REAL corresponds to training on all available synthetic and real images when available (only for tless, tudl and ycbv). SYNT+REAL models are pre-trained from PBR.

If you want to use all the models for a complete evaluation:

python -m cosypose.scripts.download --all_bop20_models

Running inference

The following commands will reproduce the results that we reported on the leaderboard for all the datasets:

# CosyPose-ECCV20-PBR-1VIEW	
python -m cosypose.scripts.run_bop_inference --config bop-pbr

# CosyPose-ECCV20-SYNT+REAL-1VIEW
python -m cosypose.scripts.run_bop_inference --config bop-synt+real

# CosyPose-ECCV20-SYNT+REAL-1VIEW-ICP	
python -m cosypose.scripts.run_bop_inference --config bop-synt+real --icp

# CosyPose-ECCV20-SYNT+REAL-4VIEWS	
python -m cosypose.scripts.run_bop_inference --config bop-synt+real --nviews=4

# CosyPose-ECCV20-SYNT+REAL-8VIEWS	
python -m cosypose.scripts.run_bop_inference --config bop-synt+real --nviews=8

The inference script is compatible with runjob.

Inference results on all datasets can be downloaded directly:

python -m cosypose.scripts.download --result_id=result_id

where result_id is given by the table below

BOP20 method name result_id
CosyPose-ECCV20-PBR-1VIEW bop-pbr--223026
CosyPose-ECCV20-SYNT+REAL-1VIEW bop-synt+real--815712
CosyPose-ECCV20-SYNT+REAL-1VIEW-ICP bop-synt+real-icp--121351
CosyPose-ECCV20-SYNT+REAL-4VIEWS bop-synt+real-nviews=4--419066
CosyPose-ECCV20-SYNT+REAL-8VIEWS bop-synt+real-nviews=8--763684

If you want to download everything:

python -m cosypose.scripts.download --all_bop20_results

Notes:

  • The ICP refiner was adapted from Pix2Pose code. Be careful if you want to use it, it slightly decrease performance over RGB-only on T-LESS instead of improving the results. Qualitative results show a misalignment of many objects after ICP, there is likely a small bug with my version but I haven't had time to go in detail. Note that our method and paper are focused on the RGB-only setting.

Running evaluation

You can run locally the evaluation on the publicly available test sets:

python -m cosypose.scripts.run_bop20_eval_multi --result_id=result_id --method=method

where method is maskrcnn_detections/refiner/iteration=4 for single-view, maskrcnn_detections/icp when ICP is ran, and maskrcnn_detections/multiview for multi-view (n_views > 1).

If you are only interested in generating the bop predictions file suitable for submission to the website, you can run

python -m cosypose.scripts.run_bop20_eval_multi --result_id=result_id --method=method --convert_only

Training details

Detection

We use torchvision's MaskRCNN implementation for the detection. The models were trained using:

runjob --ngpus=32 python -m cosypose.scripts.run_detector_training --config bop-DATASET-TRAINING_IMAGES

where DATASET={lmo,tless,tudl,icbin,itodd,hb,ycbv} and TRAINING_IMAGES={pbr,synt+real} (synt+real only for datasets where real images are available: tless, tudl and ycbv).

Pose estimation

runjob --ngpus=32 python -m cosypose.scripts.run_pose_training --config bop-DATASET-TRAINING_IMAGES-MODEL_TYPE

where MODEL_TYPE={coarse,refiner}.

cosypose's People

Contributors

azad96 avatar hassony2 avatar imankgoyal avatar ylabbe 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cosypose's Issues

TypeError: get_predictions() got an unexpected keyword argument 'use_gt_detections'

Hi, thanks for sharing.

When I try to train the coarse and refiner model for tless dataset, by running

python -m cosypose.scripts.run_pose_training --config tless-coarse
python -m cosypose.scripts.run_pose_training --config tless-refiner

the error occured

TypeError: get_predictions() got an unexpected keyword argument 'use_gt_detections'.

More details are list as follow:

100%|██████████████████████████| 3600/3600 [32:45<00:00, 1.83it/s, loss=0.0718]
100%|█████████████████████████████████████████| 360/360 [01:51<00:00, 3.22it/s]
Prediction : pix2pose_detections
Traceback (most recent call last):
File "/home/hao/anaconda3/envs/cosypose/lib/python3.7/runpy.py", line 193, in _run_module_as_main
"main", mod_spec)
File "/home/hao/anaconda3/envs/cosypose/lib/python3.7/runpy.py", line 85, in _run_code
exec(code, run_globals)
File "/home/hao/project/cosypose/cosypose/scripts/run_pose_training.py", line 207, in
train_pose(cfg)
File "/home/hao/project/cosypose/cosypose/training/train_pose.py", line 359, in train_pose
test_dict = test()
File "/home/hao/anaconda3/envs/cosypose/lib/python3.7/site-packages/torch/autograd/grad_mode.py", line 49, in decorate_no_grad
return func(*args, **kwargs)
File "/home/hao/project/cosypose/cosypose/training/train_pose.py", line 351, in test
> return run_eval(eval_bundle, epoch=epoch)
File "/home/hao/project/cosypose/cosypose/training/train_pose.py", line 182, in run_eval
results = run_pred_eval(pred_runner, pred_kwargs, eval_runner)
File "/home/hao/project/cosypose/cosypose/evaluation/runner_utils.py", line 15, in run_pred_eval
> preds = pred_runner.get_predictions(**pred_kwargs_n)
TypeError: get_predictions() got an unexpected keyword argument 'use_gt_detections'

Any suggestions about that?

Missing result file

Hello, thank you for your great work.

The result file inside these 2 notebooks is missing

  1. notebooks/visualize_multiview_predictions.ipynb (ycbv-n_views=1--5154971130/results.pth.tar)
  2. notebooks/visualize_singleview_predictions.ipynb (tless-vivo-n_views=8--2322743008/results.pth.tar)

Would you mind adding a download link for those files?

Thank you.

Cosy Pose Eval Code - n_top number

In cosy pose eval code, when we set n_top to 1, I saw ADD and other mAP values can be higher than 1. I think that code during matching uses all object available in the scene but during division it only uses n_gt_valid and so, results are being higher than 1. This is the cases where more than one object for a class is in the scene. Is this a bug?

PartialSampler and MultiEpochDataLoader

Firstly, thanks for this great repository. I want to understand a few points related to your training strategy.

The first one is batch number clipping which is done in partial sampler with "self.epoch_size = min(epoch_size, len(ds))". Why did you need something like that? I think this changes number of training samples seen in an epoch for trainings with different number of gpus. In your run_pose_training script, you normalize epoch_size with number of gpus. This means epoch_size will differ with gpu number and len(ds) will differ with batch size.

The second one is MultiEpochDataLoader. I did not understand exact purpose of this script. Why you did not use directly torch distributed dataloader?

Training on customized Dataset

Hi,
I generate my customized PBR Dataset from BlenderProc for BOP_challenge, and also generate mask and gt from bop_toolkit. Now I uesd run_pose_training.py with config "bop_ycbv_pbr_coarse". And I got the error :

Exception has occurred: AssertionError
exception: no description
File "/home/u2/cosypose/cosypose/lib3d/mesh_ops.py", line 33, in sample_points
assert n_points <= points.shape[1]
File "/home/u2/cosypose/cosypose/lib3d/rigid_mesh_database.py", line 94, in sample_points
return sample_points(self.points, n_points, deterministic=deterministic)
File "/home/u2/cosypose/cosypose/training/pose_forward_loss.py", line 29, in h_pose
points = meshes.sample_points(cfg.n_points_loss, deterministic=False)
File "/home/u2/cosypose/cosypose/training/train_pose.py", line 320, in train_epoch
loss = h(data=sample, meters=meters_train)
File "/home/u2/cosypose/cosypose/training/train_pose.py", line 353, in train_pose
train_epoch()
File "/home/u2/cosypose/run_pose_training.py", line 209, in
train_pose(cfg)

And n_points=2600, points.shape[1]=1148.

What is the reason for this error. what do the n_points und points mean?

Using cosypose for online Detection with ros.

Hello,
i want to use cosypose in a custom szenario with custom images and objects.
But I have problems understanding the code.
So I got a few questions.
What are the results of the training ? Where are they saved?
I want to train the model on one computer and carry the results to another, which just does the detection based on the pretrained model. So what components do I have to carry over ?
How and where do I have to modify cosypose to do the detection on single images, where are these detections saved ?

With best regards

Johannes Amann

No module named 'Cython', although cython is installed and up-to-date

Hi,
when I follow the specified installation steps, the command
conda env create -n cosypose --file environment.yaml
always ejects the following error message

Pip subprocess error: ERROR: Command errored out with exit status 1: command: /home/rosmatch/anaconda3/envs/cosypose/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-h16j98cf/glumpy/setup.py'"'"'; __file__='"'"'/tmp/pip-install-h16j98cf/glumpy/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-install-h16j98cf/glumpy/pip-egg-info cwd: /tmp/pip-install-h16j98cf/glumpy/ Complete output (5 lines): Traceback (most recent call last): File "<string>", line 1, in <module> File "/tmp/pip-install-h16j98cf/glumpy/setup.py", line 9, in <module> from Cython.Distutils import build_ext ModuleNotFoundError: No module named 'Cython' ---------------------------------------- ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output. failed CondaEnvException: Pip failed

However, Cython is installed and up-to-date, as shown by the output on the following commands:
pip install cython
Requirement already satisfied: cython in /home/rosmatch/anaconda3/lib/python3.8/site-packages (0.29.21)
pip install --upgrade cython
Requirement already up-to-date: cython in /home/rosmatch/anaconda3/lib/python3.8/site-packages (0.29.21)

I have already tested the installation on three different computers and always get the same error. The system used is Ubuntu 18.04.5 LTS.

I am looking forward to any help I can get.

Here is the complete output:

Collecting package metadata (repodata.json): done Solving environment: done Downloading and Extracting Packages boost-1.72.0 | 339 KB | ########################################################## | 100% octomap-1.9.5 | 457 KB | ########################################################## | 100% hpp-fcl-1.3.0 | 842 KB | ########################################################## | 100% gmp-6.2.1 | 806 KB | ########################################################## | 100% libtiff-4.1.0 | 618 KB | ########################################################## | 100% pycparser-2.20 | 94 KB | ########################################################## | 100% git-lfs-2.11.0 | 4.1 MB | ########################################################## | 100% eigenpy-2.5.0 | 1.1 MB | ########################################################## | 100% mkl-2020.4 | 215.6 MB | ########################################################## | 100% traitlets-5.0.5 | 81 KB | ########################################################## | 100% libiconv-1.16 | 1.4 MB | ########################################################## | 100% libedit-3.1.20191231 | 121 KB | ########################################################## | 100% libcurl-7.71.1 | 312 KB | ########################################################## | 100% libpng-1.6.37 | 306 KB | ########################################################## | 100% cmake-3.14.0 | 12.2 MB | ########################################################## | 100% pickleshare-0.7.5 | 9 KB | ########################################################## | 100% x264-1!152.20180806 | 1.4 MB | ########################################################## | 100% backcall-0.2.0 | 13 KB | ########################################################## | 100% gnutls-3.6.13 | 2.0 MB | ########################################################## | 100% rhash-1.3.6 | 140 KB | ########################################################## | 100% xz-5.2.5 | 343 KB | ########################################################## | 100% readline-8.0 | 281 KB | ########################################################## | 100% libwebp-base-1.1.0 | 864 KB | ########################################################## | 100% zstd-1.4.5 | 712 KB | ########################################################## | 100% libstdcxx-ng-9.3.0 | 4.0 MB | ########################################################## | 100% ffmpeg-4.2.3 | 80.2 MB | ########################################################## | 100% sqlite-3.33.0 | 1.4 MB | ########################################################## | 100% _openmp_mutex-4.5 | 5 KB | ########################################################## | 100% libgcc-ng-9.3.0 | 7.8 MB | ########################################################## | 100% libblas-3.8.0 | 11 KB | ########################################################## | 100% ipython_genutils-0.2 | 21 KB | ########################################################## | 100% gcc_linux-64-7.3.0 | 22 KB | ########################################################## | 100% tk-8.6.10 | 3.2 MB | ########################################################## | 100% pexpect-4.8.0 | 47 KB | ########################################################## | 100% boost-cpp-1.72.0 | 16.3 MB | ########################################################## | 100% six-1.15.0 | 14 KB | ########################################################## | 100% libssh2-1.9.0 | 225 KB | ########################################################## | 100% gxx_linux-64-7.3.0 | 21 KB | ########################################################## | 100% libev-4.33 | 104 KB | ########################################################## | 100% gettext-0.19.8.1 | 3.6 MB | ########################################################## | 100% libcblas-3.8.0 | 11 KB | ########################################################## | 100% openssl-1.1.1h | 2.1 MB | ########################################################## | 100% python_abi-3.7 | 4 KB | ########################################################## | 100% blas-2.17 | 11 KB | ########################################################## | 100% llvm-openmp-11.0.0 | 2.8 MB | ########################################################## | 100% freetype-2.10.4 | 912 KB | ########################################################## | 100% cudatoolkit-10.1.243 | 347.4 MB | ########################################################## | 100% libgfortran4-7.5.0 | 1.3 MB | ########################################################## | 100% console_bridge-1.0.1 | 17 KB | ########################################################## | 100% numpy-1.17.4 | 4 KB | ########################################################## | 100% numpy-base-1.17.4 | 4.1 MB | ########################################################## | 100% wheel-0.35.1 | 29 KB | ########################################################## | 100% icu-68.1 | 13.0 MB | ########################################################## | 100% expat-2.2.9 | 191 KB | ########################################################## | 100% tinyxml-2.6.2 | 60 KB | ########################################################## | 100% cffi-1.14.4 | 224 KB | ########################################################## | 100% nettle-3.6 | 6.5 MB | ########################################################## | 100% certifi-2020.11.8 | 150 KB | ########################################################## | 100% perl-5.26.2 | 15.4 MB | ########################################################## | 100% pytorch-1.3.1 | 428.0 MB | ########################################################## | 100% gcc_impl_linux-64-7. | 41.9 MB | ########################################################## | 100% binutils_impl_linux- | 9.2 MB | ########################################################## | 100% setuptools-49.6.0 | 944 KB | ########################################################## | 100% bzip2-1.0.8 | 398 KB | ########################################################## | 100% liblapack-3.8.0 | 11 KB | ########################################################## | 100% backports.functools_ | 8 KB | ########################################################## | 100% decorator-4.4.2 | 11 KB | ########################################################## | 100% libgfortran-ng-7.5.0 | 22 KB | ########################################################## | 100% eigen-3.3.8 | 971 KB | ########################################################## | 100% pinocchio-2.3.1 | 3.3 MB | ########################################################## | 100% git-2.28.0 | 15.9 MB | ########################################################## | 100% wcwidth-0.2.5 | 33 KB | ########################################################## | 100% libffi-3.2.1 | 47 KB | ########################################################## | 100% gxx_impl_linux-64-7. | 15.0 MB | ########################################################## | 100% c-ares-1.17.1 | 111 KB | ########################################################## | 100% ninja-1.10.1 | 1.9 MB | ########################################################## | 100% libuv-1.40.0 | 920 KB | ########################################################## | 100% liblapacke-3.8.0 | 11 KB | ########################################################## | 100% olefile-0.46 | 32 KB | ########################################################## | 100% openh264-2.1.1 | 1.5 MB | ########################################################## | 100% pip-19.3.1 | 1.9 MB | ########################################################## | 100% rclone-1.52.3 | 22.1 MB | ########################################################## | 100% pygments-2.7.2 | 707 KB | ########################################################## | 100% jpeg-9d | 264 KB | ########################################################## | 100% urdfdom-2.3.3 | 126 KB | ########################################################## | 100% assimp-4.1.0 | 32.2 MB | ########################################################## | 100% zlib-1.2.11 | 106 KB | ########################################################## | 100% ca-certificates-2020 | 145 KB | ########################################################## | 100% curl-7.71.1 | 139 KB | ########################################################## | 100% ld_impl_linux-64-2.3 | 616 KB | ########################################################## | 100% pillow-6.0.0 | 616 KB | ########################################################## | 100% krb5-1.17.2 | 1.4 MB | ########################################################## | 100% ptyprocess-0.6.0 | 15 KB | ########################################################## | 100% ncurses-6.2 | 985 KB | ########################################################## | 100% ipython-7.19.0 | 1.1 MB | ########################################################## | 100% backports-1.0 | 4 KB | ########################################################## | 100% lame-3.100 | 498 KB | ########################################################## | 100% libopenblas-0.3.10 | 7.8 MB | ########################################################## | 100% libnghttp2-1.41.0 | 774 KB | ########################################################## | 100% _libgcc_mutex-0.1 | 3 KB | ########################################################## | 100% torchvision-0.4.2 | 14.9 MB | ########################################################## | 100% parso-0.7.1 | 70 KB | ########################################################## | 100% jedi-0.17.2 | 948 KB | ########################################################## | 100% lz4-c-1.9.2 | 203 KB | ########################################################## | 100% urdfdom_headers-1.0. | 16 KB | ########################################################## | 100% python-3.7.6 | 53.0 MB | ########################################################## | 100% binutils_linux-64-2. | 21 KB | ########################################################## | 100% pcre-8.44 | 261 KB | ########################################################## | 100% prompt-toolkit-3.0.8 | 237 KB | ########################################################## | 100% Preparing transaction: done Verifying transaction: done Executing transaction: done Installing pip dependencies: / Ran pip subprocess with arguments: ['/home/rosmatch/anaconda3/envs/cosypose/bin/python', '-m', 'pip', 'install', '-U', '-r', '/home/rosmatch/cosypose/condaenv.7xe_glgc.requirements.txt'] Pip subprocess output: Processing ./deps/bullet3 Processing ./deps/job-runner Collecting imageio==2.6.1 Downloading https://files.pythonhosted.org/packages/1a/de/f7f985018f462ceeffada7f6e609919fbcc934acd9301929cba14bc2c24a/imageio-2.6.1-py3-none-any.whl (3.3MB) Collecting simplejson==3.17.0 Downloading https://files.pythonhosted.org/packages/98/87/a7b98aa9256c8843f92878966dc3d8d914c14aad97e2c5ce4798d5743e07/simplejson-3.17.0.tar.gz (83kB) Collecting opencv-python==4.1.2.30 Downloading https://files.pythonhosted.org/packages/d8/38/60de02a4c9013b14478a3f681a62e003c7489d207160a4d7df8705a682e7/opencv_python-4.1.2.30-cp37-cp37m-manylinux1_x86_64.whl (28.3MB) Collecting opencv-contrib-python==4.4.0.42 Downloading https://files.pythonhosted.org/packages/63/e0/9540422aa60a8ac6baabf2e3685e32008122e11aee48b955bcc2f7157217/opencv_contrib_python-4.4.0.42-cp37-cp37m-manylinux2014_x86_64.whl (55.6MB) Collecting torchnet==0.0.4 Downloading https://files.pythonhosted.org/packages/b7/b2/d7f70a85d3f6b0365517782632f150e3bbc2fb8e998cd69e27deba599aae/torchnet-0.0.4.tar.gz Collecting tqdm==4.41.1 Downloading https://files.pythonhosted.org/packages/72/c9/7fc20feac72e79032a7c8138fd0d395dc6d8812b5b9edf53c3afd0b31017/tqdm-4.41.1-py2.py3-none-any.whl (56kB) Collecting lxml==4.4.2 Downloading https://files.pythonhosted.org/packages/95/60/552fc6e027bc1158ba4691cccfdf6eb77f206f2f21d3c1c5f23b89f68a0e/lxml-4.4.2-cp37-cp37m-manylinux1_x86_64.whl (5.7MB) Collecting transforms3d==0.3.1 Downloading https://files.pythonhosted.org/packages/b5/f7/e85809168a548a854d7c1331560c27b4f5381698d29c12e57759192b2bc1/transforms3d-0.3.1.tar.gz (62kB) Collecting distributed==2.9.1 Downloading https://files.pythonhosted.org/packages/fe/ad/9c13bac92f0f05973bb6bd179d68e825fc0bb2efbfd1fd2573d57702b410/distributed-2.9.1-py3-none-any.whl (573kB) Collecting joblib==0.14.1 Downloading https://files.pythonhosted.org/packages/28/5c/cf6a2b65a321c4a209efcdf64c2689efae2cb62661f8f6f4bb28547cf1bf/joblib-0.14.1-py2.py3-none-any.whl (294kB) Collecting pandas==0.25.3 Downloading https://files.pythonhosted.org/packages/63/e0/a1b39cdcb2c391f087a1538bc8a6d62a82d0439693192aef541d7b123769/pandas-0.25.3-cp37-cp37m-manylinux1_x86_64.whl (10.4MB) Collecting xarray==0.14.1 Downloading https://files.pythonhosted.org/packages/a8/52/4a561281f536d0902d6279f47fd48894c2c7b7fb078816f18367e9ef46be/xarray-0.14.1-py3-none-any.whl (634kB) Collecting pyarrow==0.15.1 Downloading https://files.pythonhosted.org/packages/5a/ee/fd2d696eff911f76ed14feeb51e6db6783dd04abd9b8e14be4cbf48d6088/pyarrow-0.15.1-cp37-cp37m-manylinux2010_x86_64.whl (59.2MB) Collecting matplotlib==3.1.2 Downloading https://files.pythonhosted.org/packages/61/42/3e92d7aa64295483fbca20a86c89b34d0cb43cffaadaffe028793902d790/matplotlib-3.1.2-cp37-cp37m-manylinux1_x86_64.whl (13.1MB) Collecting bokeh==1.4.0 Downloading https://files.pythonhosted.org/packages/de/70/fdd4b186d8570a737372487cc5547aac885a1270626e3ebf03db1808e4ed/bokeh-1.4.0.tar.gz (32.4MB) Collecting plyfile==0.7.1 Downloading https://files.pythonhosted.org/packages/4c/15/434d1d96f9a41fea56cb3290718123d651c56c4b7e53f0249acaf1bf34b6/plyfile-0.7.1.tar.gz Collecting trimesh==3.5.16 Downloading https://files.pythonhosted.org/packages/55/8a/423dc7953c15366b6db16014822bb36e260b05daff6237497b0c2c18bd95/trimesh-3.5.16.tar.gz (397kB) Collecting pycollada==0.6 Downloading https://files.pythonhosted.org/packages/37/7d/70545d16fed218ce781f74def0cffcfdc3fe46d5c64dfe726b082befb83c/pycollada-0.6.tar.gz (103kB) Collecting shapely==1.7.0 Downloading https://files.pythonhosted.org/packages/82/43/3d04326a1e7c1d7dd8791004443b6b0ef425afda7bb2ce669c6d293e4ba0/Shapely-1.7.0-cp37-cp37m-manylinux1_x86_64.whl (1.8MB) Collecting wget==3.2 Downloading https://files.pythonhosted.org/packages/47/6a/62e288da7bcda82b935ff0c6cfe542970f04e29c756b0e147251b2fb251f/wget-3.2.zip Collecting pypng==0.0.20 Downloading https://files.pythonhosted.org/packages/bc/fb/f719f1ac965e2101aa6ea6f54ef8b40f8fbb033f6ad07c017663467f5147/pypng-0.0.20.tar.gz (649kB) Collecting PyOpenGL==3.1.0 Downloading https://files.pythonhosted.org/packages/9c/1d/4544708aaa89f26c97cc09450bb333a23724a320923e74d73e028b3560f9/PyOpenGL-3.1.0.tar.gz (1.2MB) Collecting Cython==0.29.21 Downloading https://files.pythonhosted.org/packages/6b/36/d6c18632a339dafa54fd128b0dd2c36c6dc4bc86b8e0d366ccd9f22b480a/Cython-0.29.21-cp37-cp37m-manylinux1_x86_64.whl (2.0MB) Collecting glumpy==1.1.0 Downloading https://files.pythonhosted.org/packages/1e/d9/cbc85887ec54406ffe991d42de11445e5dacd052748cf376be6403b40d61/glumpy-1.1.0.tar.gz (503kB) Pip subprocess error: ERROR: Command errored out with exit status 1: command: /home/rosmatch/anaconda3/envs/cosypose/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-h16j98cf/glumpy/setup.py'"'"'; __file__='"'"'/tmp/pip-install-h16j98cf/glumpy/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-install-h16j98cf/glumpy/pip-egg-info cwd: /tmp/pip-install-h16j98cf/glumpy/ Complete output (5 lines): Traceback (most recent call last): File "<string>", line 1, in <module> File "/tmp/pip-install-h16j98cf/glumpy/setup.py", line 9, in <module> from Cython.Distutils import build_ext ModuleNotFoundError: No module named 'Cython' ---------------------------------------- ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output. failed CondaEnvException: Pip failed

Any results on the entire test dataset of YCB-Video?

Hi, thanks for your impressive work. I have downloaded the YCB-Video results via the following command. It seems that the pose estimation results are only evaluated on BOP test dataset. Is there any results on the entire YCB-Video test dataset?

 python -m cosypose.scripts.download --result_id=ycbv-n_views=1--5154971130

Training of tless-refiner

I started the training of the refiner with the following command
runjob --ngpus=4 --queue=local python -m cosypose.scripts.run_pose_training --config tless-refiner

However, the process is stuck at some point as it can be seen from the below screenshot.
Screenshot from 2021-01-04 12-54-58

What can be the reason that the training does not end?

Problem in reproducing results

Hi,
When I try to reproduce the single-view results on T-LESS data, I get the following error after around ~40 minutes
(I'm running python -m cosypose.scripts.run_cosypose_eval --config tless-siso commnad)

5

Also, I get the following error when trying to reproduce multi-view reults
(I'm running export CUDA_VISIBLE_DEVICES=0 and then python -m cosypose.scripts.run_cosypose_eval --config tless-vivo --nviews=4)
6

Any idea?

Question about the BOP20 results

Hi Yann,

Thanks for sharing the great work!

I have some question about the BOP20 results.

Let's take the result for the LMO dataset as an example:
This is the result for scene 2 image 3 I downloaded from this repo:
Screenshot from 2021-03-28 10-16-20
This is the example result provided by the BOP website for the same dataset, same scene and same image:
Screenshot from 2021-03-28 10-16-33

This is the ground truth of the list of objects appeared in this scene:
Screenshot from 2021-03-28 10-16-58

The problem is that in this scene, there are only 8 objects in the scene (obj 1, 5, 6, 8, 9, 10, 11, 12). And in the example result from the BOP website, for each image, it only provides an estimation for each object in the scene. But in the results of CosyPose, there are estimations for objects which are not in the scene (like obj 1, 2, 4, 7, 15), and there could also be multiple estimations for an object (like obj 8, 9 and 12). Besides, obj 10 is missed in this image.

I would like to try some ICP methods based on your prediction result, and I am not sure how should I use your results correctly given the difference between it and the example results provided by the BOP website. Could you please give me some explanation on your results?

Thank you in advance!

RunTimeError: CUDA out of memory // Requirements on Graphic card?

Hi,

while executing
python -m cosypose.scripts.run_cosypose_eval --config tless-siso
I receive the following error message:

RuntimeError: CUDA out of memory. Tried to allocate 1.35 GiB (GPU 0; 5.93 GiB total capacity; 1.47 GiB already allocated; 866.50 MiB free; 36.31 MiB cached)

According to my internet research a reduction of the batch size is recommended. However, I don't know where to set it and in my understanding the batch size shouldn't play any role in this command, since I use the already pre-trained network?!

Could the cause of the error be that there are certain hardware requirements for reproducing the results?
I am using Ubuntu 18.04.5 LTS and an NVIDIA GeForce GTX 1060 6GB (and the nvidia-driver-450).

Here is a larger part of my terminal output:

1:06:35.398140 - Scene: [6]
1:06:35.398203 - Views: [359]
1:06:35.398260 - Group: [2732]
1:06:35.398285 - Image has 5 gt detections. (not used)
1:06:35.701966 - Pose prediction on 4 detections (n_iterations=1): 0:00:00.063503
1:06:35.954221 - Pose prediction on 4 detections (n_iterations=4): 0:00:00.250793
1:06:35.720832 - --------------------------------------------------------------------------------
100%|███████████████████████████████████████████████████████████| 10080/10080 [1:06:24<00:00, 2.53it/s]
1:06:47.763242 - Done with predictions
100%|█████████████████████████████████████████████████████████████| 10080/10080 [39:28<00:00, 4.26it/s]
1:46:18.765271 - Skipped: pix2pose_detections/coarse/iteration=1 (N=50023)
1:46:18.765351 - Skipped: pix2pose_detections/refiner/iteration=1 (N=50023)
1:46:18.765377 - Skipped: pix2pose_detections/refiner/iteration=2 (N=50023)
1:46:18.765398 - Skipped: pix2pose_detections/refiner/iteration=3 (N=50023)
1:46:18.765419 - Evaluation : pix2pose_detections/refiner/iteration=4 (N=50023)
0%| | 0/10080 [00:00<?, ?it/s]
Traceback (most recent call last):
File "/home/rosmatch/anaconda3/envs/cosypose/lib/python3.7/runpy.py", line 193, in run_module_as_main
"main", mod_spec)
File "/home/rosmatch/anaconda3/envs/cosypose/lib/python3.7/runpy.py", line 85, in run_code
exec(code, run_globals)
File "/home/rosmatch/cosypose/cosypose/scripts/run_cosypose_eval.py", line 491, in
main()
File "/home/rosmatch/cosypose/cosypose/scripts/run_cosypose_eval.py", line 433, in main
eval_metrics[preds_k], eval_dfs[preds_k] = eval_runner.evaluate(preds)
File "/home/rosmatch/cosypose/cosypose/evaluation/eval_runner/pose_eval.py", line 67, in evaluate
meter.add(obj_predictions, obj_data_gt.to(device))
File "/home/rosmatch/cosypose/cosypose/evaluation/meters/pose_meters.py", line 172, in add
cand_infos['label'].values)
File "/home/rosmatch/cosypose/cosypose/evaluation/meters/pose_meters.py", line 101, in compute_errors_batch
errors.append(self.compute_errors(TXO_pred
, TXO_gt
, labels_))
File "/home/rosmatch/cosypose/cosypose/evaluation/meters/pose_meters.py", line 70, in compute_errors
dists = dists_add_symmetric(TXO_pred, TXO_gt, points)
File "/home/rosmatch/cosypose/cosypose/lib3d/distances.py", line 16, in dists_add_symmetric
dists_norm_squared = (dists ** 2).sum(dim=-1)
RuntimeError: CUDA out of memory. Tried to allocate 1.35 GiB (GPU 0; 5.93 GiB total capacity; 1.47 GiB already allocated; 866.50 MiB free; 36.31 MiB cached)

No Such File Error in Reproducing Single-View Results

Hi, I downloaded the TLESS dataset from the BOP challenge's website. However, when execute the command below
python -m cosypose.scripts.run_cosypose_eval --config tless-siso
I got the following key error

Screenshot from 2020-12-17 23-39-44
Folders inside the local_data/bop_datasets/tless/test_primesense do not start with the prefix 'obj_', so I renamed all of them by adding the prefix. However, this time I got the following error
Screenshot from 2020-12-17 23-41-45

Anyone knows the reason of this error? Thanks in advance.

Learning rate warm up not linear increasing

Hello,

I am currently training a single view pose estimation model for an own set of objects following the tless pbr model. However when I compare the learning rates during the warmup phase, which is set in both cases to 50 epochs, there is a difference. The learning rate in my model is not increasing linear during the warmup phase, whereas in your trained tless pbr coarse model the learning rate increases linear during the warmup phase. Is there an additional parameter to set how the learning rate should increase during warmup phase ? After the warmup phase the learning rate is the same for both models.

Thanks in advance!

Define discrete symmetries for own object set

Hello,
first thanks for sharing this great work!
I am currently trying to train your single view pose estimation network for a own dataset. Therefore i am trying to figure out, how the discrete symmetries for the models in the file models_info.json are defined.Do you know how they define the discrete symmetries for the bop datasets? I assume it is a list of quaternions.

Thanks in advance.

Question about data augmentation & each object results

Thanks for sharing the good work.
I have some simple questions about your method.

[Data Augmentation]
Q1. Can I ask about the effect of data augmentation in the YCB dataset.
(Table 1) In the T-LESS, They show significant decrease of performance (37% to 64%).
Have you compare the data-augmentation performance in the YCB??

Q2. Data augmentation show big difference than other factors (ex. loss,network,rot)
I couldn't find the why this happened in the paper, Can I ask your opinion??

Q2. (Appendix A, Experimental findings) On YCB-Video, As I understood, Pre-training phase included data augmentation. Is it right??

[Each Object results]
Q3. If possible, Could you share the results for each objects (ex. chef_can, cracker)

Attempts to download model: refiner-bop-tless-synt+real--88131 failed.

Thank for sharing your pre-trained models. While error occurs when I trying to download the tless pre-trained model via:

python -m cosypose.scripts.download --model=refiner-bop-tless-synt+real--88131

Error Info:

0:00:00.001035 - Copying cosypose:experiments/refiner-bop-tless-synt+real--88131 to /home/username/Documents/Code/cosypose/local_data/experiments/refiner-bop-tless-synt+real--88131
2020-11-02 10:08:47 ERROR : : error reading source directory: directory not found
2020-11-02 10:08:47 ERROR : Attempt 1/3 failed with 1 errors and: directory not found
2020-11-02 10:08:47 ERROR : : error reading source directory: directory not found
2020-11-02 10:08:47 ERROR : Attempt 2/3 failed with 1 errors and: directory not found
2020-11-02 10:08:47 ERROR : : error reading source directory: directory not found
2020-11-02 10:08:47 ERROR : Attempt 3/3 failed with 1 errors and: directory not found
Transferred:             0 / 0 Bytes, -, 0 Bytes/s, ETA -
Errors:                 1 (retrying may help)

eigenpy import Error libboost_python-py27: undefined symbol: PyClass_Type

Hi,

I installed and downloaded everything as mentioned in the readme.
The command
python -m cosypose.scripts.run_cosypose_eval --config tless-siso

leads to this Error:
Setting OMP and MKL num threads to 1.
Traceback (most recent call last):
File "/home/rosmatch/anaconda3/envs/cosypose/lib/python3.7/runpy.py", line 193, in _run_module_as_main
"main", mod_spec)
File "/home/rosmatch/anaconda3/envs/cosypose/lib/python3.7/runpy.py", line 85, in _run_code
exec(code, run_globals)
File "/home/rosmatch/cosypose/cosypose/scripts/run_cosypose_eval.py", line 20, in
from cosypose.lib3d import Transform
File "/home/rosmatch/cosypose/cosypose/lib3d/init.py", line 1, in
from .transform import Transform, parse_pose_args
File "/home/rosmatch/cosypose/cosypose/lib3d/transform.py", line 3, in
import eigenpy
File "/opt/ros/melodic/lib/python2.7/dist-packages/eigenpy/init.py", line 17, in
from .eigenpy import *
ImportError: /usr/lib/x86_64-linux-gnu/libboost_python-py27.so.1.65.1: undefined symbol: PyClass_Type

The error message also occurs with other commands like
python -m cosypose.scripts.run_cosypose_eval --config tless-vivo --nviews=4
and probably all scripts which include " from cosypose.lib3d import Transform"...

I could imagine the problem is that eigenpy is loaded from the dist-packages of python2.7, but the desired python version is 3.7. But I don't know how to change this and whether this is really the reason for the error message.

I am running on Ubuntu 18.04.5 LTS.

Win10 install compile ERROR!!

My system is windows 10 and the compiler is Microsoft Visual Studio 14.0.

I installed it environment.yaml All packages in, except gxx_ linux-64=7.3.0。

I use minionda3.

When I execute "Python setup install", I get the following error:

######################################################################
(cosypose) D:\FFFFFFFF\cosypose-master>python setup.py install
信息: 用提供的模式无法找到文件。
C:\Users\KKU\miniconda3\envs\cosypose\lib\distutils\extension.py:131: UserWarning: Unknown Extension options: 'verbose'
warnings.warn(msg)
running install
running bdist_egg
running egg_info
writing cosypose.egg-info\PKG-INFO
writing dependency_links to cosypose.egg-info\dependency_links.txt
writing top-level names to cosypose.egg-info\top_level.txt
reading manifest file 'cosypose.egg-info\SOURCES.txt'
writing manifest file 'cosypose.egg-info\SOURCES.txt'
installing library code to build\bdist.win-amd64\egg
running install_lib
running build_py
running build_ext
---------------------Windows 10------------------
C:\Users\KKU\miniconda3\envs\cosypose\lib\site-packages\torch\utils\cpp_extension.py:192: UserWarning: Error checking compiler version for : [WinError 87] 参数错误。
warnings.warn('Error checking compiler version for {}: {}'.format(compiler, error))
building 'cosypose_cext' extension
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\x86_amd64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -IC:\Users\KKU\miniconda3\envs\cosypose\lib\site-packages\torch\include -IC:\Users\KKU\miniconda3\envs\cosypose\lib\site-packages\torch\include\torch\csrc\api\include -IC:\Users\KKU\miniconda3\envs\cosypose\lib\site-packages\torch\include\TH -IC:\Users\KKU\miniconda3\envs\cosypose\lib\site-packages\torch\include\THC -IC:\Users\KKU\miniconda3\envs\cosypose\include -IC:\Users\KKU\miniconda3\envs\cosypose\include "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\winrt" /EHsc /Tpcosypose/csrc/cosypose_cext.cpp /Fobuild\temp.win-amd64-3.7\Release\cosypose/csrc/cosypose_cext.obj /MD /wd4819 /EHsc -O3 -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=cosypose_cext -D_GLIBCXX_USE_CXX11_ABI=0
cl : Command line warning D9002 : ignoring unknown option '-O3'
cosypose_cext.cpp
cosypose/csrc/cosypose_cext.cpp(43): warning C4267: 'initializing': conversion from 'size_t' to 'int', possible loss of data
cosypose/csrc/cosypose_cext.cpp(48): error C2100: illegal indirection
cosypose/csrc/cosypose_cext.cpp(64): warning C4267: 'initializing': conversion from 'size_t' to 'int', possible loss of data
cosypose/csrc/cosypose_cext.cpp(138): warning C4244: 'initializing': conversion from 'pybind11::ssize_t' to 'int', possible loss of data
cosypose/csrc/cosypose_cext.cpp(157): warning C4244: 'initializing': conversion from 'pybind11::ssize_t' to 'int', possible loss of data
cosypose/csrc/cosypose_cext.cpp(162): error C2100: illegal indirection
error: command 'C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\x86_amd64\cl.exe' failed with exit status 2
#######################################################################################

Two questions
A: I want to know if cosypose can't be compiled and run under win10 at present? If it can run, how should this error be resolved?
B:The Readme didn't introduce the multi view multi objective training method. How should I train the multi view model?

No such file or directory while reproducing Multiview results

With python -m cosypose.scripts.run_cosypose_eval --config tless-vivo --nviews=4
I get the error:

(cosypose) amann@ipf-photolab-05:/cosypose$ python -m cosypose.scripts.run_bop_inference_JA --config tless-pbr
Setting OMP and MKL num threads to 1.
pybullet build time: Dec 1 2020 13:20:08
0:00:01.382220 - Save dir: /home/amann/cosypose/local_data/results/tless-pbr--280187
0:00:01.382380 - --------------------------------------------------------------------------------
0:00:01.382415 - n_workers: 8
0:00:01.382439 - pred_bsz: 1
0:00:01.382460 - n_frames: None
0:00:01.382480 - n_groups: None
0:00:01.382499 - skip_evaluation: False
0:00:01.382518 - external_predictions: True
0:00:01.382536 - n_coarse_iterations: 1
0:00:01.382554 - n_refiner_iterations: 4
0:00:01.382574 - icp: False
0:00:01.382592 - debug: False
0:00:01.382612 - n_views: 1
0:00:01.382630 - ds_name: hb.bop19
0:00:01.382652 - save_dir: /home/amann/cosypose/local_data/results/tless-pbr--280187/dataset=hb
0:00:01.382671 - detector_run_id: detector-bop-tless-pbr--873074
0:00:01.382689 - coarse_run_id: coarse-bop-tless-pbr--506801
0:00:01.382708 - refiner_run_id: refiner-bop-tless-pbr--233420
0:00:01.382726 - --------------------------------------------------------------------------------
Traceback (most recent call last):
File "/home/amann/anaconda3/envs/cosypose/lib/python3.7/runpy.py", line 193, in _run_module_as_main
"main", mod_spec)
File "/home/amann/anaconda3/envs/cosypose/lib/python3.7/runpy.py", line 85, in _run_code
exec(code, run_globals)
File "/home/amann/cosypose/cosypose/scripts/run_bop_inference_JA.py", line 270, in
main()
File "/home/amann/cosypose/cosypose/scripts/run_bop_inference_JA.py", line 266, in main
run_inference(this_cfg)
File "/home/amann/cosypose/cosypose/scripts/run_bop_inference_JA.py", line 105, in run_inference
scene_ds = make_scene_dataset(args.ds_name, n_frames=args.n_frames)
File "/home/amann/cosypose/cosypose/datasets/datasets_cfg.py", line 74, in make_scene_dataset
ds = BOPDataset(ds_dir, split='test_primesense')
File "/home/amann/cosypose/cosypose/datasets/bop.py", line 62, in init
assert ds_dir.exists(), 'Dataset does not exists.'
AssertionError: Dataset does not exists.
(cosypose) amann@ipf-photolab-05:
/cosypose$ python -m cosypose.scripts.run_cosypose_eval --config tless-vivo --nviews=4
Setting OMP and MKL num threads to 1.
pybullet build time: Dec 1 2020 13:20:08
0:00:00.000692 - Starting ...
0:00:01.383520 - SAVE DIR: /home/amann/cosypose/local_data/results/tless-vivo-n_views=4--1851779338
0:00:01.383580 - Coarse: tless-coarse--10219
0:00:01.383623 - Refiner: tless-refiner--585928
0:00:01.715244 - Building index and loading annotations...
[Memory]2.0s, 0.0min : Loading build_index...
Traceback (most recent call last):
File "/home/amann/anaconda3/envs/cosypose/lib/python3.7/runpy.py", line 193, in _run_module_as_main
"main", mod_spec)
File "/home/amann/anaconda3/envs/cosypose/lib/python3.7/runpy.py", line 85, in _run_code
exec(code, run_globals)
File "/home/amann/cosypose/cosypose/scripts/run_cosypose_eval.py", line 491, in
main()
File "/home/amann/cosypose/cosypose/scripts/run_cosypose_eval.py", line 332, in main
scene_ds = make_scene_dataset(ds_name)
File "/home/amann/cosypose/cosypose/datasets/datasets_cfg.py", line 41, in make_scene_dataset
ds = _make_tless_dataset('test_primesense')
File "/home/amann/cosypose/cosypose/datasets/datasets_cfg.py", line 18, in _make_tless_dataset
ds = BOPDataset(ds_dir, split=split)
File "/home/amann/cosypose/cosypose/datasets/bop.py", line 74, in init
self.frame_index = pd.read_feather(save_file_index).reset_index(drop=True)
File "/home/amann/anaconda3/envs/cosypose/lib/python3.7/site-packages/pandas/util/_decorators.py", line 208, in wrapper
return func(*args, **kwargs)
File "/home/amann/anaconda3/envs/cosypose/lib/python3.7/site-packages/pandas/io/feather_format.py", line 119, in read_feather
return feather.read_feather(path, columns=columns, use_threads=bool(use_threads))
File "/home/amann/anaconda3/envs/cosypose/lib/python3.7/site-packages/pyarrow/feather.py", line 214, in read_feather
reader = FeatherReader(source)
File "/home/amann/anaconda3/envs/cosypose/lib/python3.7/site-packages/pyarrow/feather.py", line 40, in init
self.open(source)
File "pyarrow/error.pxi", line 80, in pyarrow.lib.check_status
File "pyarrow/io.pxi", line 1406, in pyarrow.lib.get_reader
File "pyarrow/io.pxi", line 1395, in pyarrow.lib._get_native_file
File "pyarrow/io.pxi", line 788, in pyarrow.lib.memory_map
File "pyarrow/io.pxi", line 751, in pyarrow.lib.MemoryMappedFile._open
File "pyarrow/error.pxi", line 80, in pyarrow.lib.check_status
pyarrow.lib.ArrowIOError: Failed to open local file '/home/amann/cosypose/local_data/bop_datasets/tless/index_test_primesense.feather', error: No such file or directory

I guess there is a problem with the test_primesense folder, I already deleted it and downloaded all available tless files again, but it didn't help.
Trying to run the inference I get an Error to.

Traceback (most recent call last):
File "/home/amann/anaconda3/envs/cosypose/lib/python3.7/runpy.py", line 193, in _run_module_as_main
"main", mod_spec)
File "/home/amann/anaconda3/envs/cosypose/lib/python3.7/runpy.py", line 85, in _run_code
exec(code, run_globals)
File "/home/amann/cosypose/cosypose/scripts/run_bop_inference_JA.py", line 270, in
main()
File "/home/amann/cosypose/cosypose/scripts/run_bop_inference_JA.py", line 266, in main
run_inference(this_cfg)
File "/home/amann/cosypose/cosypose/scripts/run_bop_inference_JA.py", line 105, in run_inference
scene_ds = make_scene_dataset(args.ds_name, n_frames=args.n_frames)
File "/home/amann/cosypose/cosypose/datasets/datasets_cfg.py", line 74, in make_scene_dataset
ds = BOPDataset(ds_dir, split='test_primesense')
File "/home/amann/cosypose/cosypose/datasets/bop.py", line 62, in init
assert ds_dir.exists(), 'Dataset does not exists.'
AssertionError: Dataset does not exists.

I guess both Errors point to the test_primesense combined with the bop.py File.

Unable to download BOP challenge datasets

I am not sure if this is the right place to report an issue. But I am unable to download BOP challenge datasets from the links provided. The download links provided in the download script and the BOP challenge webpage could not be reached.
image

image

The google drive directory also does not contain the dataset.
Could you please provide me with an alternative link to download the dataset?

Multi GPU training

Hello,

I am currently training to run your training script for single view pose estimation model on multi GPU. I can run the script on 1 GPU and it trains as expected. However, when i try to run the script with the steps described in section "Note on GPU parallelization", i get the following error:

File "../cosypose/cosypose/utils/multiepoch_dataloader.py", line 44, in next
idx, batch = self.dataloader_iter._get_data()
AttributeError: '_DataLoaderIter' object has no attribute '_get_data'

Would be thankfull for any help.
Thanks in advance !

view_group keyerror

Hi, thanks for your sharing!
I run my own detector result by step 2 and 3 as in ReadMe, But it says:

Setting OMP and MKL num threads to 1.
pybullet build time: Sep 20 2020 23:49:22
0:00:00.002000 - --------------------------------------------------------------------------------
0:00:00.002170 - scenario: example
0:00:00.002226 - sv_score_th: 0.3
0:00:00.002262 - n_symmetries_rot: 64
0:00:00.002293 - ransac_n_iter: 2000
0:00:00.002325 - ransac_dist_threshold: 0.02
0:00:00.002354 - ba_n_iter: 10
0:00:00.002384 - nms_th: 0.04
0:00:00.002414 - no_visualization: False
0:00:00.002442 - --------------------------------------------------------------------------------
0:00:03.464109 - Loaded 708 candidates in 708 views.
0:00:03.480213 - Loaded cameras intrinsics.
0:00:03.737966 - Loaded 1 3D object models.
0:00:03.738085 - Running stage 2 and 3 of CosyPose...
0:00:04.871425 - Num candidates: 708
0:00:04.871581 - Num views: 708
0:00:04.874115 - Estimating camera poses using RANSAC.
0:00:05.532733 - Matched candidates: 0
0:00:05.532855 - RANSAC time_models: 0:00:00.649863
0:00:05.532897 - RANSAC time_score: 0:00:00.000510
0:00:05.532930 - RANSAC time_misc: 0:00:00.009830
Traceback (most recent call last):
File "/opt/conda/envs/cosypose/lib/python3.7/site-packages/pandas/core/indexes/base.py", line 2891, in get_loc
return self._engine.get_loc(casted_key)
File "pandas/_libs/index.pyx", line 70, in pandas._libs.index.IndexEngine.get_loc
File "pandas/_libs/index.pyx", line 101, in pandas._libs.index.IndexEngine.get_loc
File "pandas/_libs/hashtable_class_helper.pxi", line 1675, in pandas._libs.hashtable.PyObjectHashTable.get_item
File "pandas/_libs/hashtable_class_helper.pxi", line 1683, in pandas._libs.hashtable.PyObjectHashTable.get_item
KeyError: 'view_group'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "/opt/conda/envs/cosypose/lib/python3.7/runpy.py", line 193, in _run_module_as_main
"main", mod_spec)
File "/opt/conda/envs/cosypose/lib/python3.7/runpy.py", line 85, in _run_code
exec(code, run_globals)
File "/home/XX/cosypose/cosypose/scripts/run_custom_scenario.py", line 184, in
main()
File "/home/XX/cosypose/cosypose/scripts/run_custom_scenario.py", line 153, in main
for view_group in np.unique(objects.infos['view_group']):
File "/opt/conda/envs/cosypose/lib/python3.7/site-packages/pandas/core/frame.py", line 2902, in getitem
indexer = self.columns.get_loc(key)
File "/opt/conda/envs/cosypose/lib/python3.7/site-packages/pandas/core/indexes/base.py", line 2893, in get_loc
raise KeyError(key) from err
KeyError: 'view_group'

I put the detect results and model in local_data in bop format, and run "run_custom_scenario.py". And what the view_group is?

And another questions is I only have one object in each frame, and the frame is taken from a video, Does this method still work in this situation?

BOP evaluation metrics

Hello authors:
I have read your paper and look through your released code. I find that you only reported the VSD metric when you evaluate T-LESS dataset, but didn't find any report taking the BOP metric of MSSD and MSPD. However, CosyPose reports the highest record on BOP Challenge 2020 (https://bop.felk.cvut.cz/media/bop_challenge_2020_results.pdf), and BOP Challenge takes the average recall of VSD, MSSD, MSPD as the final evaluation metric.
So does your code support MSSD and MSPD? Can you show me some details about the results on MSSD and MSPD?
Thanks!

BOP20 Running evaluation (locally)

I got error while evaluating locally.
Can I ask how to handle this part??

[Command]
python -m cosypose.scripts.run_bop20_eval --result_id=bop-synt+real-nviews=8--763684 --method=maskrcnn_detections/multiview --dataset ycbv

[Error Message]
FileNotFoundError: [Errno 2] No such file or directory: '/sdata1/workspace/cosypose/local_data/bop_eval_outputs/challenge2020_ycbv-test/error=vsd_ntop=-1_delta=15.000_tau=0.050/errors_000048.json'

[Error Location]
https://github.com/ylabbe/bop_toolkit_challenge20/blob/f114991b3eea186184127cddfe6a10e2d640e656/scripts/eval_calc_scores.py#L241

[Terminal Message]

(cosypose) user@user:/sdata1/workspace/cosypose$ sh eval_bop_ycb_pose.sh 
Predictions from: /sdata1/workspace/cosypose/local_data/results/bop-synt+real-nviews=8--763684/dataset=ycbv/results.pth.tar
Method: maskrcnn_detections/multiview
Number of predictions:  9073
100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 9073/9073 [00:02<00:00, 3249.72it/s]
Wrote: 
8/28|17:28:04: ===========
8/28|17:28:04: EVALUATING: /sdata1/workspace/cosypose/local_data/bop_predictions_csv/challenge2020_ycbv-test.csv
8/28|17:28:04: ===========
8/28|17:28:04: Running: python scripts/eval_calc_errors.py --n_top=-1 --error_type=vsd --result_filenames=/sdata1/workspace/cosypose/local_data/bop_predictions_csv/challenge2020_ycbv-test.csv --renderer_type=python --results_path=/sdata1/workspace/cosypose/local_data/bop_predictions_csv --eval_path=/sdata1/workspace/cosypose/local_data/bop_eval_outputs --targets_filename=test_targets_bop19.json --max_sym_disc_step=0.01 --skip_missing=1 --vsd_deltas=hb:15,icbin:15,icmi:15,itodd:5,lm:15,lmo:15,ruapc:15,tless:15,tudl:15,tyol:15,ycbv:15 --vsd_taus=0.05,0.1,0.15000000000000002,0.2,0.25,0.3,0.35000000000000003,0.4,0.45,0.5 --vsd_normalized_by_diameter=True
8/28|17:28:04: -----------
8/28|17:28:04: Parameters:
8/28|17:28:04: - n_top: -1
8/28|17:28:04: - error_type: vsd
8/28|17:28:04: - vsd_deltas: {'hb': 15.0, 'icbin': 15.0, 'icmi': 15.0, 'itodd': 5.0, 'lm': 15.0, 'lmo': 15.0, 'ruapc': 15.0, 'tless': 15.0, 'tudl': 15.0, 'tyol': 15.0, 'ycbv': 15.0}
8/28|17:28:04: - vsd_taus: [0.05, 0.1, 0.15000000000000002, 0.2, 0.25, 0.3, 0.35000000000000003, 0.4, 0.45, 0.5]
8/28|17:28:04: - vsd_normalized_by_diameter: True
8/28|17:28:04: - max_sym_disc_step: 0.01
8/28|17:28:04: - skip_missing: True
8/28|17:28:04: - renderer_type: python
8/28|17:28:04: - result_filenames: ['/sdata1/workspace/cosypose/local_data/bop_predictions_csv/challenge2020_ycbv-test.csv']
8/28|17:28:04: - results_path: /sdata1/workspace/cosypose/local_data/bop_predictions_csv
8/28|17:28:04: - eval_path: /sdata1/workspace/cosypose/local_data/bop_eval_outputs
8/28|17:28:04: - datasets_path: /sdata1/workspace/cosypose/local_data/bop_datasets
8/28|17:28:04: - targets_filename: test_targets_bop19.json
8/28|17:28:04: - out_errors_tpath: {eval_path}/{result_name}/{error_sign}/errors_{scene_id:06d}.json
8/28|17:28:04: -----------
8/28|17:28:04: Processing: /sdata1/workspace/cosypose/local_data/bop_predictions_csv/challenge2020_ycbv-test.csv
8/28|17:28:04: Initializing renderer...
[w] b'GLX: Failed to create context: BadValue (integer parameter out of range for operation)'
[x] Window creation failed
8/28|17:28:05: Running: python scripts/eval_calc_scores.py --error_dir_paths=challenge2020_ycbv-test/error=vsd_ntop=-1_delta=15.000_tau=0.050 --eval_path=/sdata1/workspace/cosypose/local_data/bop_eval_outputs --targets_filename=test_targets_bop19.json --visib_gt_min=-1 --correct_th_vsd=0.05
8/28|17:28:05: -----------
8/28|17:28:05: Parameters:
8/28|17:28:05: - correct_th: {'vsd': [0.05], 'mssd': [0.2], 'mspd': [10.0], 'cus': [0.5], 'rete': [5.0, 5.0], 're': [5.0], 'te': [5.0], 'proj': [5.0], 'ad': [0.1], 'add': [0.1], 'adi': [0.1]}
8/28|17:28:05: - normalized_by_diameter: ['ad', 'add', 'adi', 'mssd']
8/28|17:28:05: - normalized_by_im_width: ['mspd']
8/28|17:28:05: - visib_gt_min: -1.0
8/28|17:28:05: - error_dir_paths: ['challenge2020_ycbv-test/error=vsd_ntop=-1_delta=15.000_tau=0.050']
8/28|17:28:05: - eval_path: /sdata1/workspace/cosypose/local_data/bop_eval_outputs
8/28|17:28:05: - datasets_path: /sdata1/workspace/cosypose/local_data/bop_datasets
8/28|17:28:05: - targets_filename: test_targets_bop19.json
8/28|17:28:05: - error_tpath: {eval_path}/{error_dir_path}/errors_{scene_id:06d}.json
8/28|17:28:05: - out_matches_tpath: {eval_path}/{error_dir_path}/matches_{score_sign}.json
8/28|17:28:05: - out_scores_tpath: {eval_path}/{error_dir_path}/scores_{score_sign}.json
8/28|17:28:05: -----------
8/28|17:28:05: Processing: challenge2020_ycbv-test/error=vsd_ntop=-1_delta=15.000_tau=0.050
8/28|17:28:05: Calculating score - error: vsd, method: challenge2020, dataset: ycbv.
8/28|17:28:05: Organizing estimation targets...
8/28|17:28:05: Processing scene 48 of ycbv...
Traceback (most recent call last):
  File "scripts/eval_calc_scores.py", line 223, in <module>
    scene_errs = inout.load_json(scene_errs_path, keys_to_int=True)
  File "/sdata1/workspace/cosypose/deps/bop_toolkit_challenge/bop_toolkit_lib/inout.py", line 77, in load_json
    with open(path, 'r') as f:
FileNotFoundError: [Errno 2] No such file or directory: '/sdata1/workspace/cosypose/local_data/bop_eval_outputs/challenge2020_ycbv-test/error=vsd_ntop=-1_delta=15.000_tau=0.050/errors_000048.json'
Traceback (most recent call last):
  File "/sdata1/workspace/cosypose/deps/bop_toolkit_challenge/scripts/eval_bop19.py", line 212, in <module>
    raise RuntimeError('Calculation of scores failed.')
RuntimeError: Calculation of scores failed.

The link is not available

Hello, in the "Training a single-view 6D pose estimation model" section, the link to the notebook at "Visualizing images of the dataset" is not available.
Screenshot 2021-04-30 at 15 13 14
Thanks in advance!

Question regarding Segmentation and Coarse Netwrok

First of all I congratulate you on the BOP results you have achieved. As I want to test this on my own dataset I the following questions. (I am doing my bachelor thesis and I found your paper very interesting and would like to try it out)

As written in paper and your implementation that you are using MaskRCNN to get 2D bounding boxes, does this mean that you are not using the semantic information (semantic/instance pixel segmentation) or that MaskRCNN can be replaced by any proper object detection network (similarly to DeepIM)?

My second question is have you tried using your 2nd and 3rd stage with any pose estimator other than the coarse one you developed (same Arch as the refiner) and PoseCNN? This question is to have an indication whether I'd need to have an another Architecture for Pose initializer to further enhance the results

Question about reproducing multi-view results

I have question about reproducing multi-view results in YCB.
I tried to make your results using your pretrained model.

Q1. Can I ask how to get the similar results of the paper??
And In ycb, Why not have coarse pretrained model compared to T-Less?? Does it not necessary??

1:18:06.537026 - Skipped: posecnn_init/cand_inputs (N=15435)
1:18:06.537151 - Skipped: posecnn_init/cand_matched (N=2875)
1:18:06.537197 - Skipped: posecnn_init/external_coarse (N=15435)
1:18:06.537236 - Skipped: posecnn_init/refiner/iteration=1 (N=15435)
1:18:06.537272 - Evaluation : posecnn_init/refiner/iteration=2 (N=15435)
1:42:17.024973 - Skipped: posecnn_init/scene/cameras (N=857)
1:42:17.025123 - Skipped: posecnn_init/scene/objects (N=1284)
1:42:17.060143 - --------------------------------------------------------------------------------
1:42:17.060260 - Results:
PoseCNN/AUC of ADD(-S): 0.6128217168893441
Singleview/AUC of ADD(-S): 0.5329731760227406
Singleview/AUC of ADD-S: 0.6900167570728803
Multiview (n=5)/AUC of ADD(-S): 0.5320449810191621
Multiview (n=5)/AUC of ADD-S: 0.6895387685823141

I followed this command twice but got same results.
python -m cosypose.scripts.run_cosypose_eval --config ycbv --nviews=5

I downloaded pretrained using this command

# YCB-V Single-view refiner
python -m cosypose.scripts.download --model=ycbv-refiner-finetune--251020

Error: No folder named models in tless dataset folder

Hi, I have downloaded tless dataset and was trying to run:

python -m cosypose.scripts.run_bop_inference --config bop-synt+real --nviews=1

The following error occurs:

FileNotFoundError: [Errno 2] No such file or directory: '/home/username/Documents/Code/cosypose/local_data/bop_datasets/tless/models/models_info.json'

In the tless dataset folder, the name of models are models_cad, models_eval, and models_reconst, should I just change the name of models_eval to models? Thanks.

linemod dataset

Hello, may I ask, can this code directly train and evaluate the linemod dataset? Thank you

Inference on a single image

hi,

i can't find code how to inference on a rgb image, Do you have a demo? for example, give a image containing tless objects,and inference it by using pre-trained models. Thank you!

Difference between posecnn and posecnn_init/external_coarse?

Hi, thanks for your good work.

I am checking your single view result on ycb-video dataset by taking a look at your 'ycbv-n_views=1--5154971130' result posted online. I am wondering the difference between posecnn and posecnn_init/external_coarse. It is obvious that posecnn result can directly borrow from their result as you mentioned in the paper. But what does posecnn_init/external_coarse do based on that? Do you run your CNN coarse network on it or something else? I am curious because when I visualize some of the views, posecnn_init/external_coarse will give me more predictions than posecnn. For example, for scene 49, view 785,
posecnn_init/external_coarse will give me the following one
posecnn_init_external_coarse

while posecnn's result is here:
posecnn

I assumed posecnn_init_external_coarse would only refine the posecnn result a little bit rather than predict something new.

Could you help me understand the process? Thank you so much.

By the way, here is part of the result from 'ycbv-n_views=1--5154971130':

OrderedDict([('posecnn',
PandasTensorCollection(
poses: torch.Size([493920, 4, 4]) torch.float32 cpu,
bboxes: torch.Size([493920, 4]) torch.float32 cpu,
----------------------------------------
infos:
scene_id view_id score label batch_pred_id
0 48 1 1.0 obj_000001 0
1 48 1 20.0 obj_000020 1
2 48 1 14.0 obj_000014 2
3 48 1 19.0 obj_000019 3
4 48 1 6.0 obj_000006 4
... ... ... ... ... ...
493915 59 1857 15.0 obj_000015 15430
493916 59 1857 6.0 obj_000006 15431
493917 59 1857 9.0 obj_000009 15432
493918 59 1857 4.0 obj_000004 15433
493919 59 1857 18.0 obj_000018 15434
[493920 rows x 5 columns]
)),
('posecnn_init/external_coarse',
PandasTensorCollection(
poses: torch.Size([15435, 4, 4]) torch.float32 cpu,
bboxes: torch.Size([15435, 4]) torch.float32 cpu,
----------------------------------------
infos:
scene_id view_id score label det_id batch_im_id group_id
0 48 733 1.0 obj_000001 342 0 92
1 48 733 20.0 obj_000020 343 0 92
2 48 733 14.0 obj_000014 344 0 92
3 48 733 6.0 obj_000006 345 0 92
4 48 733 21.0 obj_000021 346 0 92
... ... ... ... ... ... ... ...
15430 59 561 2.0 obj_000002 14151 0 2732
15431 59 561 9.0 obj_000009 14152 0 2732
15432 59 561 6.0 obj_000006 14153 0 2732
15433 59 561 4.0 obj_000004 14154 0 2732
15434 59 561 18.0 obj_000018 14155 0 2732
[15435 rows x 7 columns]
)),

Training on T-LESS PBR dataset

I want to train the single-view 6D pose estimation models with PBR dataset instead of the synthetic images mentioned in the repo. Hence, I skipped the synthetic data generation part and tried to start the training with the following command (I did not use runjob as I have a single gpu)
python -m cosypose.scripts.run_pose_training --config tless-coarse
This results in the following error

Setting OMP and MKL num threads to 1.
pybullet build time: Dec 20 2020 13:52:50
0:00:00.000927 - Training with config: tless-coarse 
0:00:00.001180 - --------------------------------------------------------------------------------
0:00:00.001214 - resume_run_id: None
0:00:00.001235 - urdf_ds_name: tless.cad
0:00:00.001254 - object_ds_name: tless.cad
0:00:00.001271 - n_symmetries_batch: 64
0:00:00.001290 - train_ds_names: [('synthetic.tless-1M.train', 1), ('tless.primesense.train', 5)]
0:00:00.001307 - val_ds_names: [('synthetic.tless-1M.val', 1)]
0:00:00.001324 - val_epoch_interval: 10
0:00:00.001340 - test_ds_names: ['tless.primesense.test']
0:00:00.001357 - test_epoch_interval: 30
0:00:00.001373 - n_test_frames: None
0:00:00.001389 - input_resize: (540, 720)
0:00:00.001406 - rgb_augmentation: True
0:00:00.001422 - background_augmentation: True
0:00:00.001438 - gray_augmentation: False
0:00:00.001453 - backbone_str: efficientnet-b3
0:00:00.001469 - run_id_pretrain: None
0:00:00.001485 - n_pose_dims: 9
0:00:00.001501 - n_rendering_workers: 8
0:00:00.001517 - refiner_run_id_for_test: None
0:00:00.001533 - coarse_run_id_for_test: None
0:00:00.001552 - lr: 0.0003
0:00:00.001568 - weight_decay: 0.0
0:00:00.001585 - n_epochs_warmup: 50
0:00:00.001600 - lr_epoch_decay: 500
0:00:00.001617 - clip_grad_norm: 0.5
0:00:00.001633 - batch_size: 32
0:00:00.001649 - epoch_size: 115200
0:00:00.001665 - n_epochs: 700
0:00:00.001681 - n_dataloader_workers: 8
0:00:00.001697 - loss_disentangled: True
0:00:00.001712 - n_points_loss: 2600
0:00:00.001728 - TCO_input_generator: fixed
0:00:00.001743 - n_iterations: 1
0:00:00.001759 - min_area: None
0:00:00.001774 - run_id: tless-coarse--309342
0:00:00.001790 - train_refiner: False
0:00:00.001806 - train_coarse: True
0:00:00.001828 - save_dir: /home/azad/Desktop/cosypose/local_data/experiments/tless-coarse--309342
0:00:00.001844 - --------------------------------------------------------------------------------
0:00:01.385036 - Connection established with 1 gpus.
Traceback (most recent call last):
  File "/home/azad/anaconda3/envs/cosypose/lib/python3.7/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/home/azad/anaconda3/envs/cosypose/lib/python3.7/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/home/azad/Desktop/cosypose/cosypose/scripts/run_pose_training.py", line 207, in <module>
    train_pose(cfg)
  File "/home/azad/Desktop/cosypose/cosypose/training/train_pose.py", line 226, in train_pose
    scene_ds_train = make_datasets(args.train_ds_names)
  File "/home/azad/Desktop/cosypose/cosypose/training/train_pose.py", line 220, in make_datasets
    ds = make_scene_dataset(ds_name)
  File "/home/azad/Desktop/cosypose/cosypose/datasets/datasets_cfg.py", line 139, in make_scene_dataset
    ds = SyntheticSceneDataset(ds_dir=LOCAL_DATA_DIR / 'synt_datasets' / ds_name, train=is_train)
  File "/home/azad/Desktop/cosypose/cosypose/datasets/synthetic_dataset.py", line 21, in __init__
    keys = pkl.loads(keys_path.read_bytes())
  File "/home/azad/anaconda3/envs/cosypose/lib/python3.7/pathlib.py", line 1209, in read_bytes
    with self.open(mode='rb') as f:
  File "/home/azad/anaconda3/envs/cosypose/lib/python3.7/pathlib.py", line 1203, in open
    opener=self._opener)
  File "/home/azad/anaconda3/envs/cosypose/lib/python3.7/pathlib.py", line 1058, in _opener
    return self._accessor.open(self, flags, mode)
FileNotFoundError: [Errno 2] No such file or directory: '/home/azad/Desktop/cosypose/local_data/synt_datasets/tless-1M/train_keys.pkl'

Should I download this file from somewhere? and do I need to make changes as I want to use PBR?

Coarse and Refiner

I have a small question which is not related to repository but paper. Can you explain difference of coarse and refiner models with a sentence?

As I understand, both model use same architecture and both of them applicable to single view prediction. In both of them, number of iteration for iterative improvement can be set to a number higher than 1. Coarse model initial pose estimations for rendering is set such that camera is located at the center of object in x-y dimension and distance between them in z-dimension is 1m. But as I understand this is different for refiner model, refiner model use predictions from a coarse model. So is the only difference between them is initialization of TCO?

AttributeError: module 'pinocchio' has no attribute 'Quaternion'

Thanks for your great work, can you help me to solve the below problem?
cosypose/cosypose/lib3d/transform.py
need pinocchio 2.3.1
so I download it here https://anaconda.org/conda-forge/pinocchio/files?version=2.3.1

But when I ran transform.py

I got :
AttributeError: module 'pinocchio' has no attribute 'Quaternion'

in pinocchio'document from github https://github.com/stack-of-tasks/pinocchio

I can't find Quaternion too. What's wrong?

Config file as a part of the cosypose package

Hi there, thanks a lot for sharing your work.
Installing the config.py file as a part of the entire cosypose package is not so intuitive in my opinion.
Sometimes you want to change the configuration and it feels funny to be required to re-install it every time.
I wanted to suggest the config.py file will be moved out of the cosypose/cosypose directory.

No such file or directory

Hi, when I run : python -m cosypose.scripts.run_cosypose_eval --config ycbv, something is wrong.
I have download ycb video and related files.
image

Could you give me some advice? Thanks!

Possible to run on a Smartphone?

Hi, I was wondering if it might be possible to run your 6D Pose Estimator even on the limited hardware of a smartphone. Before diving too deep into it, I wanted to get the opinion of more experienced people in the field.

If you think it is possible, is a rough estimation for fps possible (Lets assume it would run on an Adreno 650 mobile GPU)?

If you think it is not possible could you briefly elaborate on the reasons.

Any insights are appreciated. Thank you very much!

Configuration with runjob-config

Hello, when I got to the 'Training details' in the 'BOP20 models and results' section, using
'runjob --ngpus=1 python -m cosypose.scripts.run_detector_training --config bop-ycbv-synt+real' to train the ycbv dataset on the synthetic + real image, the problem occursScreenshot from 2021-04-26 18-10-10

I modified the job-runner-config.yaml, as shows:

Screenshot from 2021-04-26 18-11-15
and used 'runjob-config job-runner-config.yaml', but got the same error.

Before that, the 'Installation' and 'Downloading and preparing data' sections were successfully completed. Since I wanted to do it with a single local GPU, I just used the command line 'export CUDA_VISIBLE_DEVICES=0' and 'python -m cosypose.scripts.example_multigpu' in the 'Note on GPU parallization' section. But that works in 'Reproducing single-view results' part.

Could anyone help me with this? Thanks in advance!

Multiview Code

Hi,
I want to ask how can be give given camera extrinsic parameters for multiview prediction instead of estimation relative poses with RANSAC? Also, does poses improved with mutliview prediction or multiview prediction just used to fill missed objects in the prediction of view ?

Download quota exceeded for the synthetic data zip files in google drive

Hello,
I am interested in downloading the synthetic data generated for this project. I tried using the download script as well as the link directly and got the message "Download quota exceeded for this file, so you can't download it at this time".

Both t-less and ycbv have this message. I waited 24 hours to see if the message would disappear - in case that google reset the download quota for the files - but to no avail.

Could you make it available another way? Is there a way to reset the google file download quota as owners?

Thanks!

No such file or directory

Hi, i run the code:python -m cosypose.scripts.run_cosypose_eval --config ycbv
it shows:
No such file or directory: '/home/yuan/doc/objectpose/cosypose/local_data/bop_datasets/ycbv/test'
And it seems that ycbv has not test file:
Screenshot from 2020-10-16 22-21-30

So do you have any suggestion for this case?

git lfs pull giving error

git lfs pull is giving the following error:
batch response: This repository is over its data quota. Account responsible for LFS bandwidth should purchase more data packs to restore access.
error: failed to fetch some objects from 'https://github.com/ylabbe/cosypose.git/info/lfs'

Could you please increase the quota or provide another way to get to the repository?
Thanks.

How the Multi-view multi-object scene reconstruction procedure is done with 1 view input?

Hi, thanks for your work. I have some questions about the Multi-view multi-object scene reconstruction. It seems to me that the Multi-view multi-object scene reconstruction needs multiple pairs of image inputs, but the result of T-LESS ViVo 1 view is also provided. I am wondering how the Multi-view multi-object scene reconstruction procedure is done with single image input. I have read the paper but not fully understood. Could you briefly explain that? Thanks in advance!

stuck on singleview visualization

Hi,I have run the run_cosypose_eval.py and get the 'results/xxxx/results.pth.tar', then I want to visualize the output so I run the visualize_singleview_predictions.ipynb but the html picture I get there is no objects rendered. I print the TCO.

Setting OMP and MKL num threads to 1.
pybullet build time: Nov 18 2020 10:41:54
datasets_cfg.py tless.primesense.test
0:00:00.699286 - Building index and loading annotations...
[Memory]1.0s, 0.0min : Loading build_index...
self.all_labels ['obj_101', 'obj_102', 'obj_103', 'obj_104', 'obj_105', 'obj_107', 'obj_108', 'obj_109', 'obj_110', 'obj_111', 'obj_112']
EGL device choice: 0 of 10 (from EGL_VISIBLE_DEVICES)
Loaded EGL 1.5 after reload.
GL_VENDOR=NVIDIA Corporation
GL_RENDERER=TITAN RTX/PCIe/SSE2
GL_VERSION=4.6.0 NVIDIA 450.80.02
GL_SHADING_LANGUAGE_VERSION=4.60 NVIDIA
Version = 4.6.0 NVIDIA 450.80.02
Vendor = NVIDIA Corporation
Renderer = TITAN RTX/PCIe/SSE2
TWO R =
0.999047 -0.0096753 -0.0425613
-0.028929 -0.876956 -0.4797
-0.0326831 0.480474 -0.8764
p = -0.624104 -1.52404 2.19855

TWO R =
0.999572 -0.00120914 -0.0292267
-0.0279897 -0.329852 -0.943618
-0.00849952 0.944032 -0.329744
p = -0.44151 -1.62043 2.61096

TWO R =
0.999217 -0.0169255 -0.0357491
-0.0346052 -0.811816 -0.582887
-0.019156 0.583668 -0.811767
p = -0.57851 -0.982422 2.13662

TWO R =
0.999214 -0.0152667 -0.0365939
-0.032582 -0.842089 -0.538354
-0.0225965 0.539123 -0.841924
p = -0.726713 -0.688979 2.10162

TWO R =
0.999357 -0.00802674 -0.034947
-0.0297393 -0.73004 -0.682757
-0.0200324 0.683358 -0.729809
p = -0.818724 -1.20954 2.21362

TWO R =
0.999251 -0.0148427 -0.0357447
-0.0338669 -0.78238 -0.62188
-0.0187355 0.622624 -0.782296
p = -0.970052 -0.791749 2.15384

can someone help me?
by the way, I found the code in bullet_scene_renderer.py, are those objects rendered through this code?:

def render_scene(self, obj_infos, cam_infos, render_depth=False):
    self.setup_scene(obj_infos)
    return self.render_images(cam_infos, render_depth=render_depth)

def setup_scene(self, obj_infos):
    labels = [obj['name'] for obj in obj_infos]
    bodies = self.body_cache.get_bodies_by_labels(labels)
   
    for (obj_info, body) in zip(obj_infos, bodies):
        TWO = Transform(obj_info['TWO'])
        body.pose = TWO
        print('TWO', TWO)
        color = obj_info.get('color', None)
        if color is not None:
            pb.changeVisualShape(body.body_id, -1, physicsClientId=0, rgbaColor=color)
    return bodies

but the returned bodies never used, I wonder how does it work? by passing address?
many thanks!

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.