GriffinLiang / vrd-dsr

Code for Visual Relationship Detection with Deep Structural Ranking (AAAI2018)
122 stars 32 forks source link

Visual Relationship Detection with Deep Structural Ranking

The code is written in python and pytorch (0.2.0) [torch-0.2.0.post3].

Since I have graduated, I may not be able to respond to the issues in time. Thanks for your understanding.

Clone the repo

Data Preparation

  1. Download VRD Dateset (image, annotation, backup) and put it in the path ~/data. Replace ~/data/sg_dataset/sg_test_images/4392556686_44d71ff5a0_o.gif with ~/data/vrd/4392556686_44d71ff5a0_o.jpg

  2. Download VGG16 trained on ImageNet and put it in the path ~/data

  3. Download the meta data (so_prior.pkl) [Baidu YUN] or [Google Drive] and put it in ~/data/vrd

  4. Download visual genome data (vg.zip) [Baidu YUN] or [Google Drive] and put it in ~/data/vg

  5. Word2vec representations of the subject and object categories are provided in this project. If you want to use the model for novel categories, please refer to this blog.

The folder should be:

├── sg_dataset
│   ├── sg_test_images
│   ├── sg_train_images
│   
├── VGG_imagenet.npy
└── vrd
    ├── gt.mat
    ├── obj.txt
    ├── params_emb.pkl
    ├── proposal.pkl
    ├── rel.txt
    ├── so_prior.pkl
    ├── test.pkl
    ├── train.pkl
    └── zeroShot.mat

Data format

Prerequisites

Installation

Demo

Train

Model Structure

Citation

If you use this code, please cite the following paper(s):

@article{liang2018Visual,
    title={Visual Relationship Detection with Deep Structural Ranking},
    author={Liang, Kongming and Guo, Yuhong and Chang, Hong and Chen, Xilin},
    booktitle={AAAI Conference on Artificial Intelligence},
    year={2018}
}

License

The source codes and processed data can only be used for none-commercial purpose.