code for paper "ContourPoseļ¼A monocular 6D pose estimation method for reflective texture-less metal parts".
-
Set up the python environment:
conda create -n ContourPose python=3.7 conda activate ContourPose
pip install -r requirements.txt
-
Prepare the dataset
-
The training and testing dataset for ContourPose can be found here. Unzip all files.
-
Download the SUN397
wget http://groups.csail.mit.edu/vision/SUN/releases/SUN2012pascalformat.tar.gz
-
-
Create soft link
mkdir $ROOT/data ln -s path/to/Real Images $ROOT/data/train ln -s path/to/Synthetic Images $ROOT/data/train/renders ln -s path/to/Test Scenes $ROOT/data/test ln -s path/to/SUN2012pascalformat $ROOT/data/SUN2012pascalformat
For more details on the file path, please refer to
dataset/Dataset.py
. -
Object index mapping
Since the dataset was still under construction when the paper was completed, the actual indexing of the objects may differ from that in the paper. Please refer to the index mapping relationships below.
Indexing of objects in the paper (dataset) | obj1 | obj2 | obj3 | obj4 | obj5 | obj6 | obj7 | obj8 | obj9 | obj10 |
---|---|---|---|---|---|---|---|---|---|---|
Actual indexing of objects in this code | obj1 | obj2 | obj3 | obj7 | obj13 | obj16 | obj18 | obj18 | obj21 | obj32 |
The test scenes in which the target object is tested can be found in the sceneObjs.yml
file.
Download the pretrained models from here and put them to $ROOT/model/obj{}/150.pkl
-
Training Take the training on
obj1
as an example. runpython main.py --class_type obj1 --train True
-
Testing Take the testing on
obj1
as an example.The
sceneObjs.yml
file shows that obj1 is in scene with an index of 2. runpython main.py --class_type obj1 --eval True --scene 13 --index 2
The graspScript
folder contains scripts for deploying multiple models in parallel and implementing multi-target pose estimation, and provides code that visualizes the results.