Skip to main content

VizWiz-FewShot dataset API

Project description

VizWiz-FewShot

VizWiz-FewShot Cover Image

Introduction

The VizWiz-FewShot dataset provides nearly 10,000 segmentations of 100 categories on over 4,500 images that were taken by people with visual impairments. These annotations include unique features compared to other datasets, such as holes in objects, a larger range in object size, and significantly more objects containing text. Please read our paper to learn more:

VizWiz-FewShot: Locating Objects in Images Taken by People With Visual Impairments. Yu-Yun Tseng, Alexander Bell, and Danna Gurari. European Conference on Computer Vision (ECCV), 2022.

You are in the right place if you are looking for the VizWiz-FewShot API. This API aims to make it as easy as possible to train and evaluate your object detection or instance segmentation model on the VizWiz-FewShot dataset. Read on for more information.

Dataset download

Before you can use our API, you must download the dataset. Links to download the images and annotations are available here.

Alternatively, you can run the following series of commands. This will create a directory dataset with all the files in your current directory.

$ mkdir -p dataset/images dataset/annotations
$ cd dataset
$ wget https://vizwiz.cs.colorado.edu/VizWiz_final/images/train.zip \
       https://vizwiz.cs.colorado.edu/VizWiz_final/images/val.zip \
       https://vizwiz.s3.us-east-2.amazonaws.com/annotations.zip \
       https://vizwiz.s3.us-east-2.amazonaws.com/annotations.json
$ unzip -o train.zip -d images
$ unzip -o val.zip -d images
$ unzip -o annotations.zip -d annotations
$ rm train.zip val.zip annotations.zip

API

Installation

Please run the following command to install our Python package from PyPI.

$ pip install vizwiz-fewshot

PyTorch usage

We provide implementations of PyTorch's torch.utils.data.Dataset for both object detection and instance segmentation. You will supply an instance to a torch.utils.data.DataLoader. To read more about how these work on a deeper level, navigate here.

Note: This assumes you are following the standard 4-fold cross-validation approach for model evaluation used in the few-shot learning community.

Object detection

import ObjectDetectionDataset from vizwiz
...

# Initialize Dataset's

IMAGE_PATH = 'dataset/images'
ANNOTATION_PATH = 'dataset/annotations.json'

# You may need special transforms on the images for your data.
# There is no transformation by default. However, here we
# transform the images into a `torch.tensor` object.
base_dataset = ObjectDetectionDataset(
    root=IMAGE_PATH,
    annFile=ANNOTATION_PATH,
    transform=torchvision.transforms.ToTensor(),
    fold=0, # Enter the fold here,
    set_type='base'
)

support_dataset = ObjectDetectionDataset(
    root=IMAGE_PATH,
    annFile=ANNOTATION_PATH,
    transform=torchvision.transforms.ToTensor(),
    fold=0,
    set_type='support',
    shots=1 # Enter the number of shots here
)

query_dataset = ObjectDetectionDataset(
    root=IMAGE_PATH,
    annFile=ANNOTATION_PATH,
    transform=torchvision.transforms.ToTensor(),
    fold=0,
    set_type='query'
)

# Initialize DataLoader's. Configure as needed following the PyTorch docs.
base_loader = torch.utils.data.DataLoader(base_dataset)
support_loader = torch.utils.data.DataLoader(support_dataset)
query_loader = torch.utils.data.DataLoader(query_dataset)

# Training

# Begin by training on the base set
for i, data in enumerate(base_loader):
    ...

# Fine-tune on the support set
for i, data in enumerate(support_loader):
    ...

# Evaluate on the query set
for i, data in enumerate(query_dataset):
    ...

...

Instance segmentation

Instructions will be posted soon.

Citation

If you make use of our dataset for your research, please be sure to cite our work with the following BibTeX citation.

@misc{https://doi.org/10.48550/arxiv.2207.11810,
  doi = {10.48550/ARXIV.2207.11810},
  url = {https://arxiv.org/abs/2207.11810},
  author = {Tseng, Yu-Yun and Bell, Alexander and Gurari, Danna},
  keywords = {Computer Vision and Pattern Recognition (cs.CV), FOS: Computer and information sciences, FOS: Computer and information sciences},
  title = {VizWiz-FewShot: Locating Objects in Images Taken by People With Visual Impairments},
  publisher = {arXiv},
  year = {2022},
  copyright = {Creative Commons Attribution 4.0 International}
}

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

vizwiz-fewshot-1.0.0.tar.gz (4.8 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

vizwiz_fewshot-1.0.1-py3-none-any.whl (5.4 kB view details)

Uploaded Python 3

vizwiz_fewshot-1.0.0-py3-none-any.whl (5.4 kB view details)

Uploaded Python 3

File details

Details for the file vizwiz-fewshot-1.0.0.tar.gz.

File metadata

  • Download URL: vizwiz-fewshot-1.0.0.tar.gz
  • Upload date:
  • Size: 4.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.13

File hashes

Hashes for vizwiz-fewshot-1.0.0.tar.gz
Algorithm Hash digest
SHA256 8fcbaef1183b1bf6c6ebb54ac32b4df4340643eae32154a9bb609d4549b6c71b
MD5 2f5848ab42410373246e6e3a4d84920e
BLAKE2b-256 4f984aa9fa23e0750a0eec124beafb2fa996533c6effd91bec8f9322ae97da78

See more details on using hashes here.

File details

Details for the file vizwiz_fewshot-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: vizwiz_fewshot-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 5.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.13

File hashes

Hashes for vizwiz_fewshot-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 c7b60222da137dea0a61ff9b61cd918e5af945308de2e3dd719b160cb25453bc
MD5 00ac4d83863763fc54e232fdc3f3c1c1
BLAKE2b-256 1a85ce6f1e7dbcdccecc446a3653a5540b7ed13319046256bc22eba80d8f5e5b

See more details on using hashes here.

File details

Details for the file vizwiz_fewshot-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: vizwiz_fewshot-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 5.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.13

File hashes

Hashes for vizwiz_fewshot-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 803215c122a96b7811c2ddd0330fa6323431e523e921592bc86fdbd5abb2c59a
MD5 fafd54ed74e1de32d8734de3a7f4cf93
BLAKE2b-256 8a9e559843a0aa9e56a2b5d0c0e9a1e48a44df1e45a1ef661b2e609c6462774e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page