Code Monkey home page Code Monkey logo

kac-net's Introduction

KAC-Net

This repository contains tensorflow implementation for Knowledge Aided Consistency for Weakly Supervised Phrase Grounding in CVPR 2018.

Setup

Note: Please read the feature representation files in feature and annotation directories before using the code.

Platform: Tensorflow-1.1.0 (python 2.7)
Visual features: We use Faster-RCNN pre-trained on PASCAL 2012 VOC for Flickr30K Entities, and pre-trained on ImageNet for Referit Game. Please put visual features in the feature directory (More details can be seen in the README.md in this directory).
Global features: We extract the global visual feature for each image in Flickr30K Entities using a pre-trained Faster-RCNN on PASCAL VOC 2012 and store them in the folder global_feat.
Sentence features: We encode one-hot vector for each query, as well as the annotation for each query and image pair. Please put the encoded features in the annotation directory (More details are provided in the README.md in this directory).
File list: We generate a file list for each image in the Flickr30K Entities. If you would like to train and test on other dataset (e.g. Referit Game), please follow the similar format in the flickr_train_val.lst and flickr_test.lst.
Hyper parameters: Please check the Config class in the train.py.

Training & Test

Before training, we first pre-train GroundeR model (unsupervised scenario) and save the pre-trained model in the folder model/ground_unsupervised_base (epoch 53). The implementation of GroundeR is in this repository.

For training, please enter the root folder of KAC-Net, then type

$ python train.py -m [Model Name] -g [GPU ID] -k [knowledge]

You can choose different types of knowledge (-k option) as KBP values: coco and hard_coco are for soft and hard KBP values with a Faster-RCNN pre-trained on MSCOCO respectively. pas and hard_pas are for soft and hard KBP values with a VGG Network pre-trained on PASCAL VOC 2012 respectively. More details can be found in the paper.

For testing, please enter the root folder of KAC-Net, then type

$ python evaluate.py -m [Model Name] -g [GPU ID] -k [knowledge] --restore_id [Restore epoch ID]

Make sure the model name entered for evaluation is the same as the model name in training, and the epoch id exists.

Reference

If you find the repository is useful for your research, please consider citing the following work:

@inproceedings{Chen_2018_CVPR,
  title={Knowledge Aided Consistency for Weakly Supervised Phrase Grounding},
  author={Chen, Kan and Gao, Jiyang and Nevatia, Ram},
  booktitle={CVPR},
  year={2018}
}

kac-net's People

Contributors

kanchen-usc avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.