Canonical Capsules: Unsupervised Capsules in Canonical Pose (NeurIPS 2021)

Overview

Canonical Capsules: Unsupervised Capsules in Canonical Pose (NeurIPS 2021)

teaser

Introduction

This is the official repository for the PyTorch implementation of "Canonical Capsules: Unsupervised Capsules in Canonical Pose" by Weiwei Sun*, Andrea Tagliasacchi*, Boyang Deng, Sara Sabour, Soroosh Yazdani, Geoffrey Hinton, Kwang Moo Yi.

Download links

Citation

⚠️ If you use this source core or data in your research (in any shape or format), we require you to cite our paper as:

@conference{sun2020canonical,
   title={Canonical Capsules: Unsupervised Capsules in Canonical Pose},
   author={Weiwei Sun and Andrea Tagliasacchi and Boyang Deng and 
           Sara Sabour and Soroosh Yazdani and Geoffrey Hinton and
           Kwang Moo Yi},
   booktitle={Neural Information Processing Systems},
   year={2021}
}

Requirements

Please install dependencies with the provided environment.yml:

conda env create -f environment.yml

Datasets

  • We use the ShapeNet dataset as in AtlasNetV2: download the data from AtlasNetV2's official repo and convert the downloaded data into h5 files with the provided script (i.e., data_utils/ShapeNetLoader.py).

  • For faster experimentation, please use our 2D planes dataset, which we generated from ShapeNet (please cite both our paper, as well as ShapeNet if you use this dataset).

Training/testing (2D)

To train the model on 2D planes (training of network takes only 50 epochs, and one epoch takes approximately 2.5 minutes on an NVIDIA GTX 1080 Ti):

./main.py --log_dir=plane_dim2 --indim=2 --scheduler=5

To visualize the decompostion and reconstruction:

./main.py --save_dir=gifs_plane2d --indim=2 --scheduler=5 --mode=vis --pt_file=logs/plane_dim2/checkpoint.pth

Training/testing (3D)

To train the model on the 3D dataset:

./main.py --log_dir=plane_dim3 --indim=3 --cat_id=-1

We test the model with:

./main.py --log_dir=plane_dim3 --indim=3 --cat_id=-1 --mode=test

Note that the option cat_id indicates the category id to be used to load the corresponding h5 files (this look-up table):

id category
-1 all
0 bench
1 cabinet
2 car
3 cellphone
4 chair
5 couch
6 firearm
7 lamp
8 monitor
9 plane
10 speaker
11 table
12 watercraft

Pre-trained models (3D)

We release the 3D pretrained models for both single categy (airplanes), as well as multi-category (all 13 classes).

Classification

To use our classification script:

python classification.py --data_dir=/path/to/saved/features --feature_type=caca --method_type=svm --use_kpts
Comments
  • 3D point cloud visualization

    3D point cloud visualization

    hi,weiwei.when i use canonical to train 3D point cloud ,but when i vision it by your visual script(./main.py --save_dir=gifs_plane3d --indim=3 -- --mode=vis --pt_file=logs/plane_dim3/checkpoint.pth), it look terrible ,can you give me a hand,whether something i did wrong plane image image car image

    opened by pxing6 10
  • Some txt missing

    Some txt missing

    Hello, I find that some txt files are needed in data_dump_folder. However, the folder is not included in this project. Could you please upload these txt files such as synsetoffset2category.txt and train_cat.txt? Besides, would you please instruct how to train with custom data?

    opened by lyuweiwang 6
  • Classification Feature Specification

    Classification Feature Specification

    Hi there, thanks for the amazing work. I have a question about the classification script. save_feat in network.py is in test mode, but in forward_test, the model only returns acc and an empty feature dict, could you please provide the components of the feature you used in classification? image image

    opened by curiosity654 4
  • Question about aligner and shape completion of non-canonicalized object

    Question about aligner and shape completion of non-canonicalized object

    Hi, thanks for your work. It's a fantastic read.

    I have a question about the aligner. From the paper, I understand that there is a decomposition, canonicalisation and autoencoder part to the method. Where does the aligner fit within this framework? It seems to me that the aligner encompasses the decomposition and canonicalisation framework, am I right in assuming that?

    My goal is to try and use canonical capsules to complete the shape of incomplete lidar object scans that are not in a canonicalised pose. How can I adopt the configurations to do so? This was my result when I tried to feed a KITTI car into canonical capsules without normalizing to canonical pose.

    image

    opened by darrenjkt 3
  • random_T_100k_uni-180-0.2.h5 error message = No such directory

    random_T_100k_uni-180-0.2.h5 error message = No such directory

    I have been trying this code for my project but am encountering this error message "random_T_100k_uni-180-0.2.h5 error message = No such directory". Kindly tell me the:

    1. Significance of this file
    2. Where to find/generate this file @taiya @wsunid @Awcrr
    opened by amandeep25 3
  • About visualization

    About visualization

    Hi, first thanks for your inspiring work! Point cloud rendering figures in your paper are very beautiful as follows. How do you draw it? Using open3d, meshlab or other programmes?

    Thanks! image

    opened by StevenZzz07 3
  • ShapeNet Dataset Preparation

    ShapeNet Dataset Preparation

    data_utils/ShapeNetLoader.py has many paths that are hard to understand.

    What is data_dump/ , data_dump/ShapeNet, data_dump/ShapeNet/customShapeNet data_dump/ShapeNet/ShapeNet data_dump/ShapeNet/ShapeNet/ShapNetRendering (no longer available with the link in AtlasNetV2 README.md) ./data/ShapeNetCorev2 etc. ?

    Could you post a correct folder map so that ShapeNetLoader.py can run successfully? Or a detail instruction on how to prepare the ShapeNet data downloaded with AtlasNetV2?

    opened by ArthLeu 3
  • num_ref_pcd

    num_ref_pcd

    Hi @wsunid,

    Thanks for your great work. While I was reading your code, I got confused by the argument "self.num_ref_pcd". Coud u plz explain why you use it and why is it set to 1. Thank you.

    opened by Crane-YU 2
  • Misc confusions.

    Misc confusions.

    1. What is the definition of self.ref_pcd? https://github.com/canonical-capsules/canonical-capsules/blob/fd4a69c19073ab63bb1511703386dcd9eed9e021/models/acne_ae.py#L145

    I am not sure whether I had something wrong when interpreting the code. Appreciate your help, many thanks!

    opened by ZhaoyangZh 2
  • a question about the operation of the source code

    a question about the operation of the source code

    Hello, I'm a novice in deep learning, because there are no comments on the code and I don't have enough experience. I'd like to ask you some questions about the operation of the source code. When I tried to train 2D plane data set shapenet_plane_2d, I reported an error "filenotfounderror: [errno 2] no such file or directory: 'data_ dump/ShapeNetAtlasNetH5/train_ cat.txt '”。 But I don't see this folder in the cloned file. I don't also know where to create the folder data_dump_folder. How can I modify it? Thank you very much!

    opened by sycamore27 2
  • Dataset Download Link is Invalid

    Dataset Download Link is Invalid

    Hi,

    Thanks for the great work! The download link of "ShapeNet dataset as in AtlasNetV2" is invalid. Could you provide the alternative, or maybe directly the download link of the h5 file data (for 3D)? Thanks.

    opened by ardianumam 0
Owner
null
PyTorch implementation of NIPS 2017 paper Dynamic Routing Between Capsules

Dynamic Routing Between Capsules - PyTorch implementation PyTorch implementation of NIPS 2017 paper Dynamic Routing Between Capsules from Sara Sabour,

Adam Bielski 475 Dec 24, 2022
Pytorch implementation of Hinton's Dynamic Routing Between Capsules

pytorch-capsule A Pytorch implementation of Hinton's "Dynamic Routing Between Capsules". https://arxiv.org/pdf/1710.09829.pdf Thanks to @naturomics fo

Tim Omernick 625 Oct 27, 2022
Official implementation of the paper "Topographic VAEs learn Equivariant Capsules"

Topographic Variational Autoencoder Paper: https://arxiv.org/abs/2109.01394 Getting Started Install requirements with Anaconda: conda env create -f en

T. Andy Keller 69 Dec 12, 2022
Repository for the paper "PoseAug: A Differentiable Pose Augmentation Framework for 3D Human Pose Estimation", CVPR 2021.

PoseAug: A Differentiable Pose Augmentation Framework for 3D Human Pose Estimation Code repository for the paper: PoseAug: A Differentiable Pose Augme

Pyjcsx 328 Dec 17, 2022
[NeurIPS 2021] Code for Unsupervised Learning of Compositional Energy Concepts

Unsupervised Learning of Compositional Energy Concepts This is the pytorch code for the paper Unsupervised Learning of Compositional Energy Concepts.

null 45 Nov 30, 2022
Dense Unsupervised Learning for Video Segmentation (NeurIPS*2021)

Dense Unsupervised Learning for Video Segmentation This repository contains the official implementation of our paper: Dense Unsupervised Learning for

Visual Inference Lab @TU Darmstadt 173 Dec 26, 2022
[NeurIPS 2021] ORL: Unsupervised Object-Level Representation Learning from Scene Images

Unsupervised Object-Level Representation Learning from Scene Images This repository contains the official PyTorch implementation of the ORL algorithm

Jiahao Xie 55 Dec 3, 2022
Code for "Learning Canonical Representations for Scene Graph to Image Generation", Herzig & Bar et al., ECCV2020

Learning Canonical Representations for Scene Graph to Image Generation (ECCV 2020) Roei Herzig*, Amir Bar*, Huijuan Xu, Gal Chechik, Trevor Darrell, A

roei_herzig 24 Jul 7, 2022
Canonical Appearance Transformations

CAT-Net: Learning Canonical Appearance Transformations Code to accompany our paper "How to Train a CAT: Learning Canonical Appearance Transformations

STARS Laboratory 54 Dec 24, 2022
Finite-temperature variational Monte Carlo calculation of uniform electron gas using neural canonical transformation.

CoulombGas This code implements the neural canonical transformation approach to the thermodynamic properties of uniform electron gas. Building on JAX,

FermiFlow 9 Mar 3, 2022
Simple Pose: Rethinking and Improving a Bottom-up Approach for Multi-Person Pose Estimation

SimplePose Code and pre-trained models for our paper, “Simple Pose: Rethinking and Improving a Bottom-up Approach for Multi-Person Pose Estimation”, a

Jia Li 256 Dec 24, 2022
This repository contains codes of ICCV2021 paper: SO-Pose: Exploiting Self-Occlusion for Direct 6D Pose Estimation

SO-Pose This repository contains codes of ICCV2021 paper: SO-Pose: Exploiting Self-Occlusion for Direct 6D Pose Estimation This paper is basically an

shangbuhuan 52 Nov 25, 2022
Python scripts for performing 3D human pose estimation using the Mobile Human Pose model in ONNX.

Python scripts for performing 3D human pose estimation using the Mobile Human Pose model in ONNX.

Ibai Gorordo 99 Dec 31, 2022
pytorch implementation of "Contrastive Multiview Coding", "Momentum Contrast for Unsupervised Visual Representation Learning", and "Unsupervised Feature Learning via Non-Parametric Instance-level Discrimination"

Unofficial implementation: MoCo: Momentum Contrast for Unsupervised Visual Representation Learning (Paper) InsDis: Unsupervised Feature Learning via N

Zhiqiang Shen 16 Nov 4, 2020
The official implementation of NeMo: Neural Mesh Models of Contrastive Features for Robust 3D Pose Estimation [ICLR-2021]. https://arxiv.org/pdf/2101.12378.pdf

NeMo: Neural Mesh Models of Contrastive Features for Robust 3D Pose Estimation [ICLR-2021] Release Notes The offical PyTorch implementation of NeMo, p

Angtian Wang 76 Nov 23, 2022
Back to the Feature: Learning Robust Camera Localization from Pixels to Pose (CVPR 2021)

Back to the Feature with PixLoc We introduce PixLoc, a neural network for end-to-end learning of camera localization from an image and a 3D model via

Computer Vision and Geometry Lab 610 Jan 5, 2023
This is an official implementation of our CVPR 2021 paper "Bottom-Up Human Pose Estimation Via Disentangled Keypoint Regression" (https://arxiv.org/abs/2104.02300)

Bottom-Up Human Pose Estimation Via Disentangled Keypoint Regression Introduction In this paper, we are interested in the bottom-up paradigm of estima

HRNet 367 Dec 27, 2022
Official PyTorch implementation of "IntegralAction: Pose-driven Feature Integration for Robust Human Action Recognition in Videos", CVPRW 2021

IntegralAction: Pose-driven Feature Integration for Robust Human Action Recognition in Videos Introduction This repo is official PyTorch implementatio

Gyeongsik Moon 29 Sep 24, 2022
Code for Pose-Controllable Talking Face Generation by Implicitly Modularized Audio-Visual Representation (CVPR 2021)

Pose-Controllable Talking Face Generation by Implicitly Modularized Audio-Visual Representation (CVPR 2021) Hang Zhou, Yasheng Sun, Wayne Wu, Chen Cha

Hang_Zhou 628 Dec 28, 2022