Code Monkey home page Code Monkey logo

grounder's Introduction

GroundeR

This repository contains implementation for Grounding of Textual Phrases in Images by Reconstruction in ECCV 2016.

Setup

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

Platform: Tensorflow-1.0.1 (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). (Fine-tuned features can achieve better performance, which are available in this repository).
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_supervise.py and train_unsupervise.py.

Training & Test

We implement both supervised and unsupervised scenarios of GroundeR model.

Supervised Model

For training, please enter the root folder of GroundeR, then type

$ python train_supervise.py -m [Model Name] -g [GPU ID]

For testing, please enter the root folder of GroundeR, then type

$ python evaluate_supervise.py -m [Model Name] -g [GPU ID] --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.

Unsupervised Model

The implementation of unsupervised model of GroundeR is a little different from the paper: In Equation 5, original GroundeR adopts a softmax function to calculate attention weights, while we adopt a relu function to generate these weights. We observe a performance drop by using softmax function. To try original GroundeR model, please uncomment line 96 and comment line 97 in model_unsupervise.py.
For training, please enter the root folder of GroundeR, then type

$ python train_unsupervise.py -m [Model Name] -g [GPU ID]

For testing, please enter the root folder of GroundeR, then type

$ python evaluate_unsupervise.py -m [Model Name] -g [GPU ID] --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.

grounder'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

Watchers

 avatar

grounder's Issues

About Sentence features download

Thanks for your implementation of GroundeR.
And I don't know how to obtain sentence features still, will you provide the link for download?
Thank you very much.

About sentence features

Hello,

Very nice solution and everything is almost clear but, can you please provide the link for downloading the sentence features file(s). I didn't find the sentence features file in your directory. I will be waiting for your response.

Regards,

batch_size sets limit on num_samples?

Hello, a group of us are trying to use your codebase and potentially extend it. We've forked the repo and have setup all of our pre-processing on the Flickr30k dataset and we believe we have setup the paths to the data and everything correctly. We are however running into a problem and are unsure how to fix it, or were hoping that you had come to a similar problem and fixed it before

Upon running python train_supervise.py we get the following error:

  File "train_supervise.py", line 170, in <module>
    tf.app.run()
  File "/home/brunoprela/6.883/GroundeR/env/local/lib/python2.7/site-packages/tensorflow/python/platform/app.py", line 44, in run
    _sys.exit(main(_sys.argv[:1] + flags_passthrough))
  File "train_supervise.py", line 167, in main
    run_training()
  File "train_supervise.py", line 159, in run_training
    eval_accu = run_eval(sess, cur_dataset, model, logits, feed_dict)
  File "train_supervise.py", line 86, in run_eval
    img_feat[i] = img_feat_raw
IndexError: index 40 is out of bounds for axis 0 with size 40

Any help or guidance on why this error is occurring would be appreciated. We do not understand why the batch_size is impacting the num_samples size. The error appears because img_feat is running out of items in the list. We believe the error is simple but have nonetheless been working on it for a day and haven't been able to get it working. I can provide any further output/examples/print statements. Thank you.

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.