Skip to main content

ConsNet

DOI arXiv PyPI License

This repository maintains the official implementation of the paper ConsNet: Learning Consistency Graph for Zero‐Shot Human‐Object Interaction Detection by Ye Liu, Junsong Yuan and Chang Wen Chen, which has been accepted by ACM Multimedia 2020.

Installation

The ConsNet package could be installed directly from PyPI or manually from source for different uses. Please refer to the following environmental settings that we use.

Install from PyPI

You may install ConsNet from PyPI and import it in your own project as a Python package. This library implements several useful functionalities including Pair IoU, Pair NMS and unified APIs for HICO-DET dataset.

Simply run the following command to install the latest version of ConsNet.

pip install consnet

For more details about consnet.api, please refer to our documentation.

Install from source

By installing ConsNet from source, you may access the full capabilities of this project, including pooling object features, constructing the consistency graph and benchmarking the ConsNet model.

  1. Clone the repository from GitHub.
git clone https://github.com/yeliudev/ConsNet.git
cd ConsNet
  1. Install full dependencies and the package.
pip install -e .[full]

Getting Started

We pre-extract the visual features of all the humans and objects in the dataset and save them for training as well as testing. These features are also used to construct the consistency graph. Please refer to our paper for more details about feature extraction and data sampling.

Build dataset and construct the consistency graph

  1. Download the checkpoints of object detector and ELMo.
# Object detector checkpoints
wget https://dl.catcatdev.com/consnet/faster_rcnn_r50_fpn_3x_coco-26df6f6b.pth
wget https://dl.catcatdev.com/consnet/faster_rcnn_r50_fpn_20e_hico_det-77b91312.pth

# ELMo options and weights
wget https://dl.catcatdev.com/consnet/elmo_2x4096_512_2048cnn_2xhighway_5.5B_options.json
wget https://dl.catcatdev.com/consnet/elmo_2x4096_512_2048cnn_2xhighway_5.5B_weights.hdf5
  1. Download HICO-DET dataset and prepare the files in the following structure.
ConsNet
├── configs
├── consnet
├── tools
├── checkpoints
│   ├── faster_rcnn_r50_fpn_3x_coco-26df6f6b.pth
│   ├── faster_rcnn_r50_fpn_20e_hico_det-77b91312.pth
│   ├── elmo_2x4096_512_2048cnn_2xhighway_5.5B_options.json
│   └── elmo_2x4096_512_2048cnn_2xhighway_5.5B_weights.hdf5
├── data
│   └── hico_20160224_det
│       ├── anno_bbox.mat
│       └── images
│           ├── train2015
│           └── test2015
├── README.md
├── setup.py
└── ···
  1. Convert the annotations to COCO format. The results will be saved in data/hico_det/annotations.
python tools/convert_anno.py
  1. Build dataset and construct the consistency graph. The results will be saved in data/hico_det.
python tools/build_dataset.py --checkpoint <path-to-checkpoint>

Train a model

Run the following command to train a model using specified configs.

python tools/launch.py --config <path-to-config>

Test a model and evaluate results

Run the following command to test a model and evaluate results.

python tools/launch.py --config <path-to-config> --checkpoint <path-to-checkpoint> --eval

Customization

Thanks to the modulized implementation based on NNCore, this project is highly customizable with a number of replaceable modules. You may play with the hyperparameters in configs or construct your own HOI detection pipeline by replacing the dataset, detector, embedder, etc. Please check the documentation of NNCore for more details about customizing the engine and modules.

Citation

If you find this project useful for your research, please kindly cite our paper.

@inproceedings{liu2020consnet,
  title={ConsNet: Learning Consistency Graph for Zero-Shot Human-Object Interaction Detection},
  author={Liu, Ye and Yuan, Junsong and Chen, Chang Wen},
  booktitle={Proceedings of the 28th ACM International Conference on Multimedia},
  pages={4235--4243},
  year={2020}
}

Metadata

Release files for consnet 1.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for consnet 1.2.0
File Size Uploaded Provenance Actions
consnet-1.2.0.tar.gz 36.3 kB Without provenance Details for consnet-1.2.0.tar.gz

Release files / consnet-1.2.0.tar.gz

Download URL consnet-1.2.0.tar.gz
Size 36.3 kB
Tags Source
SHA-256 checksum
How to use checksums
f116ff28d1834d8a77a53b8d06fdc8ab3dfe37cf44c4a75ecc1a67337497cafd
BLAKE2b-256 checksum
How to use checksums
27ab46bd3b2936c52792330b288d08d3d3432bb5ba3d92ce2c6cbe8f4387c675
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.9.7

Security for consnet 1.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.2.0 This release

1 release file No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page