Skip to main content

easy-vqa

Build Status PyPI

The official repository for the Easy Visual Question Answering (easy-VQA) dataset. Contains:

  • the official Python package for the dataset
  • the source code for generating the dataset

Read the easy-VQA blog post for more.

About the Dataset

easy-VQA contains

  • 4,000 train images and 38,575 train questions.
  • 1,000 test images and 9,673 test questions.
  • 13 total possible answers.
  • 28,407 training questions that are yes/no.
  • 7,136 testing questions that are yes/no.

All images are 64x64 color images. See a live demo of a model trained on the dataset.

Example Images

(these image links above only work on Github)

Example Questions

  • What color is the rectangle?
  • Does the image contain a triangle?
  • Is no blue shape present?
  • What shape does the image contain?

Installing the Package

pip install easy-vqa

Using the Package

Questions

Each question has 3 parts:

  • the question text
  • the answer
  • the image ID

The question getters return corresponding arrays for each of the 3 parts:

from easy_vqa import get_train_questions, get_test_questions

train_questions, train_answers, train_image_ids = get_train_questions()
test_questions, test_answers, test_image_ids = get_test_questions()

# Question 0 is at index 0 for all 3 arrays:
print(train_questions[0]) # what shape does the image contain?
print(train_answers[0])   # circle
print(train_image_ids[0]) # 0

Images

The image path getters return dicts that map image ID to absolute paths that can be used to load the image.

from easy_vqa import get_train_image_paths, get_test_image_paths

train_image_paths = get_train_image_paths()
test_image_paths = get_test_image_paths()

print(train_image_paths[0]) # ends in easy_vqa/data/train/images/0.png

Answers

The answers getter returns an array of all possible answers.

from easy_vqa import get_answers

answers = get_answers()

print(answers) # ['teal', 'brown', 'black', 'gray', 'yes', 'blue', 'rectangle', 'yellow', 'triangle', 'red', 'circle', 'no', 'green']

Generating the Dataset

The easy-VQA dataset was generated by running

python gen_data/generate_data.py

which writes to the easy_vqa/data/ directory. Be sure to install the dependencies for dataset generation running generate_data.py:

pip install -r gen_data/requirements.txt

If you want to generate a larger easy-VQA dataset, simply modify the NUM_TRAIN and NUM_TEST constants in generate_data.py. Otherwise, if you want to modify the dataset itself, the files and code in the gen_data/ directory should be pretty self-explanatory.

Release files for easy-vqa 1.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 easy-vqa 1.0
File Size Uploaded
easy-vqa-1.0.tar.gz 2.0 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for easy-vqa 1.0
File Interpreter ABI Platform
easy_vqa-1.0-py3-none-any.whl Python 3 none any Details

Total release size: 5.2 MB

Release files / easy-vqa-1.0.tar.gz

Download URL easy-vqa-1.0.tar.gz
Size 2.0 MB
Tags Source
SHA-256 checksum
How to use checksums
f49e98f314ef1ed1606f1b9d8ec33200bc9b6f6e45a0a6503b1c171a087daaee
BLAKE2b-256 checksum
How to use checksums
5147b26fe69575594d45801cb368a43da7d0a720165177dd12caef69e5446e12
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.6.2 requests-toolbelt/0.9.1 tqdm/4.41.1 CPython/3.7.2

Release files / easy_vqa-1.0-py3-none-any.whl

Download URL easy_vqa-1.0-py3-none-any.whl
Size 3.2 MB
Tags Python 3
SHA-256 checksum
How to use checksums
fcb51b309b78c7b00f97b64cdbcbcf5c105f94da1b39c0796cee5a787c4f650f
BLAKE2b-256 checksum
How to use checksums
32e7dbdd733ea110ff04c8b0b7ce7d49acce06f1dd18ed304d9f8f9b3f26c1a3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.6.2 requests-toolbelt/0.9.1 tqdm/4.41.1 CPython/3.7.2

Release history Release notifications | RSS feed

This release

1.0 This release

2 release files

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