cd ./ # root directory of the cloned repository
conda activate CompNet
Download the following data and unzip it to data/
.
Download the pretrained models and unzip to ./
.
The above link contains pretrained models including rotation module, axis length module, joint module.
To reproduce the prediction results of the paper, run the following code
- Predict shapes with ground truth part masks
bash ./scripts/predict_shape_with_gt_mask.sh chair
bash ./scripts/predict_shape_with_gt_mask.sh bed
bash ./scripts/predict_shape_with_gt_mask.sh table
bash ./scripts/predict_shape_with_gt_mask.sh cabinet
- Predict shapes with ground truth part masks
bash ./scripts/predict_shape_with_predicted_mask.sh chair
bash ./scripts/predict_shape_with_predicted_mask.sh bed
bash ./scripts/predict_shape_with_predicted_mask.sh table
bash ./scripts/predict_shape_with_predicted_mask.sh cabinet
python ./CompNet/train.py --cfg ./configs/RotNet.yaml
We provide two choices of axis length module: unary axis length module and group axis length module.
- Train unary axis length module
python ./CompNet/train.py --cfg ./configs/AxisLengthNet.yaml
- Train group axis length module. Two seperate modules need to be trained. One classify whether two parts are translation symmetry and another module predict axis length given a group of parts.
python ./CompNet/train.py --cfg ./configs/GroupAxisLengthNet.yaml
python ./CompNet/train.py --cfg ./configs/SizeRelationNet.yaml
In experiments, unary axis length module also generates satisfactory predictions.
python ./CompNet/train.py --cfg ./configs/JointNet.yaml
We provide visualization tools to help understand each module predictions.
- After run the testing code
bash ./scripts/predict_shape_with_gt_mask.sh bed
- Go the prediction directory
cd ./outputs/prediction_gt_mask/bed
- Run
python -m http.server 8003
and open link
The link provides prediction and visualization as follows.
rot/ # contains prediction results after rotation module
table.html # collections of predictions
...
size/ # contains prediction results after rotation module and axis length module
table.html
center/ # contains the final prediction results
table_seq.html
Example visualization of rotation module. Note the visualization below takes ground truth size and center.
Example visualization of size module. Note the visualization below takes ground truth center.
Example visualization of center module. Note we sequentially assemble the shape together. All rotation, size, and center are from predictions.