All Projects → vmichals → FigureQA-baseline

vmichals / FigureQA-baseline

Licence: MIT License
TensorFlow implementation of the CNN-LSTM, Relation Network and text-only baselines for the paper "FigureQA: An Annotated Figure Dataset for Visual Reasoning"

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to FigureQA-baseline

RelationNetworks-CLEVR
A pytorch implementation for "A simple neural network module for relational reasoning", working on the CLEVR dataset
Stars: ✭ 83 (+196.43%)
Mutual labels:  relation-network, visual-question-answering
bottom-up-features
Bottom-up features extractor implemented in PyTorch.
Stars: ✭ 62 (+121.43%)
Mutual labels:  vqa, visual-question-answering
just-ask
[TPAMI Special Issue on ICCV 2021 Best Papers, Oral] Just Ask: Learning to Answer Questions from Millions of Narrated Videos
Stars: ✭ 57 (+103.57%)
Mutual labels:  vqa, visual-question-answering
self critical vqa
Code for NeurIPS 2019 paper ``Self-Critical Reasoning for Robust Visual Question Answering''
Stars: ✭ 39 (+39.29%)
Mutual labels:  vqa, visual-question-answering
AoA-pytorch
A Pytorch implementation of Attention on Attention module (both self and guided variants), for Visual Question Answering
Stars: ✭ 33 (+17.86%)
Mutual labels:  vqa, visual-question-answering
fundamental-tools
Web applications with ABAP, done simple.
Stars: ✭ 42 (+50%)
Mutual labels:  microsoft
rebucket
ReBucket – A Method for Clustering Duplicate Crash Reports based on Call Stack Similarity
Stars: ✭ 21 (-25%)
Mutual labels:  microsoft
CleanUnwantedUpdates
A set of scripts to detect updates of Microsoft (TM) Windows (TM) OS which harm users' privacy and uninstall them
Stars: ✭ 24 (-14.29%)
Mutual labels:  microsoft
Windows-Python-RAT
A New Microsoft Windows Remote Administrator Tool [RAT] with Python by Sir.4m1R.
Stars: ✭ 70 (+150%)
Mutual labels:  microsoft
Windows-Optimize-Harden-Debloat
Fully Optimize, Harden, and Debloat Windows 10 and Windows 11 Deployments to Windows Best Practices and DoD STIG/SRG Requirements. The ultimate Windows 10 & 11 security and privacy script!
Stars: ✭ 304 (+985.71%)
Mutual labels:  microsoft
DotNetDynamicInjector
💉 Dynamically reference external dlls without the need to add them to the project. Leave your project with low dependency and allowing specific dlls according to your business rule or database parameters.
Stars: ✭ 18 (-35.71%)
Mutual labels:  microsoft
WFAv7 Installer
Batch script to install Windows 10 ARMv7 to Lumia devices (Dual boot with Windows Phone).
Stars: ✭ 33 (+17.86%)
Mutual labels:  microsoft
opensource-management-portal
Microsoft's monolithic GitHub Management Portal enabling enterprise scale self-service powered by the GitHub API 🏔🧑‍💻🧰
Stars: ✭ 369 (+1217.86%)
Mutual labels:  microsoft
Fluent-Design
Microsoft's Fluent Design with pure HTML/CSS/JS
Stars: ✭ 36 (+28.57%)
Mutual labels:  microsoft
azureselected
Azure Selected content localization.
Stars: ✭ 17 (-39.29%)
Mutual labels:  microsoft
awesome-power-automate-learning-resources
A curated collection of learning resources to help deepen your understanding of the Microsoft Power Automate service. Updated regularly. Contributions encouraged via a pull request (see contributing.md).
Stars: ✭ 38 (+35.71%)
Mutual labels:  microsoft
cadru
A Microsoft .NET Framework toolkit
Stars: ✭ 58 (+107.14%)
Mutual labels:  microsoft
StoreLib
Storelib is a DotNet library that provides APIs to interact with the various Microsoft Store endpoints.
Stars: ✭ 21 (-25%)
Mutual labels:  microsoft
VBA-IDE-Code-Export
Export & Import VBA code for use with Git (or any VCS)
Stars: ✭ 89 (+217.86%)
Mutual labels:  microsoft
Relation-Network-PyTorch
Implementation of Relation Network and Recurrent Relational Network using PyTorch v1.3. Original papers: (RN) https://arxiv.org/abs/1706.01427 (RRN): https://arxiv.org/abs/1711.08028
Stars: ✭ 17 (-39.29%)
Mutual labels:  relation-network

FigureQA-Baseline

This repository contains the TensorFlow implementations of the CNN-LSTM, Relation Network and text-only baselines for our paper FigureQA: An Annotated Figure Dataset for Visual Reasoning [Project Page].

If you use code from this repository for your scientific work, please cite

Kahou, S. E., Michalski, V., Atkinson, A., Kadar, A., Trischler, A., & Bengio, Y. (2017). Figureqa: An annotated figure dataset for visual reasoning. arXiv preprint arXiv:1710.07300.

If you use the Relation Network implementation, please also cite

Santoro, A., Raposo, D., Barrett, D. G., Malinowski, M., Pascanu, R., Battaglia, P., & Lillicrap, T. (2017). A simple neural network module for relational reasoning. In Advances in neural information processing systems (pp. 4974-4983).

Getting started

The setup was tested with python 3, tensorflow 1.4 and 1.6.0-rc1. We recommend using the Anaconda Python Distribution.

  1. Create a virtual machine, e.g. via
conda create -p ~/venvs/figureqa python=3
  1. Activate the environment:
source activate ~/venvs/figureqa
  1. Install dependencies:
conda install numpy tqdm six matplotlib pandas
pip install tensorflow-gpu 
  1. Download the FigureQA data set tar.gz archives (unextracted) into a directory named FigureQA.

  2. Clone the baseline repository somewhere locally (here we're using $HOME/workspace)

mkdir -p ~/workspace
cd ~/workspace
git clone [email protected]:vmichals/FigureQA-Baseline.git

Training and Evaluation

Training a model

Run the training script for the model. It takes the following required arguments:

  • --data-path: the directory, in which you placed the tar.gz archives of FigureQA, referred to as DATAPATH in the following.
  • --tmp-path: a temporary directory, in which the script will extract the data (preferably on fast storage, such as an SSD or a RAM disk), from now on referred to as TMPPATH
  • --model: the model you want to train (rn, cnn or text), from now on referred to as MODEL
  • --num-gpus: the number of GPUs to use (in the same machine), from now on referred to as NUMGPU
  • --val-set: the validation set to use for early-stopping (validation1 or validation2), from now on referred to as VALSET
  • (additional configuration options can be found in the *.json files in the cfg subfolder)
cd ~/workspace/FigureQA-baseline
python -u train_model_on_figureqa.py --data-path DATAPATH --tmp-path TMPPATH \
    --model MODEL --num-gpus NUMGPU --val-set VALSET

Resuming interrupted training

To resume interrupted training, run the resume script, which takes the following required arguments:

  • --data-path: same as for the training script
  • --tmp-path: same as for the training script
  • --train-dir: the training directory created by the training script (a subfolder of the train_dir), from now on referred to as TRAINDIR
  • --num-gpus: same as for the training script
  • --resume-step: the time-step from which to resume (check training directory for the model-TIMESTEP.meta file with the largest TIMESTEP), from now on referred to as RESUMESTEP
cd ~/workspace/FigureQA-baseline
python -u resume_train_model_on_figureqa.py --train-dir TRAINDIR --resume-step RESUMESTEP \
    --num-gpus NUMGPU --data-path DATAPATH --tmp-path TMPPATH

Testing

To evaluate a trained model, run the eval script, which takes the following required arguments:

  • --train-dir: same as for the resume script
  • --meta-file: the meta file of the trained model, e.g. "model_val_best.meta" from the
  • --data-path: same as for the resume and training script
  • --tmp-path: same as for the resume and training script

Example:

cd ~/workspace/FigureQA-baseline
python -u ./eval_model_on_figureqa.py  --train-dir TRAINDIR --meta-file METAFILE \
    --partition test2 --data-path DATAPATH --tmp-path TMPPATH

For the test1 and test2 partitions, the script will dump your predictions to a csv file. To get the test accuracy, please submit the file here and we will get back to you with the results as soon as possible.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].